I'm using a chained component to do simple service orchestration. The first
component in the chain is a ValidateComponent and the second a simple
CopyTransformer:
<sm:activationSpec
componentName="BPKAbfrageVerarbeitung"
service="test:BPKAbfrageVerarbeitung"
endpoint="BPKAbfrageVerarbeitung"
destinationService="test:receiver">
<sm:component>
<bean xmlns=""
class="org.apache.servicemix.components.util.ChainedComponent">
<property name="services">
<list>
<bean class="javax.xml.namespace.QName">
<constructor-arg
value="http://www.sozialversicherung.at/zpvtest"/>
<constructor-arg
value="BPKAbfrageValidierung"/>
</bean>
<bean class="javax.xml.namespace.QName">
<constructor-arg
value="http://www.sozialversicherung.at/zpvtest"/>
<constructor-arg
value="BPKMockErgebnis"/>
</bean>
</list>
</property>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec
componentName="BPKAbfrageValidierung"
service="test:BPKAbfrageValidierung"
endpoint="BPKAbfrageValidierung">
<sm:component>
<bean
class="org.apache.servicemix.components.validation.ValidateComponent">
<property name="schemaResource"
value="ZMRBPK.xsd"/>
</bean>
</sm:component>
</sm:activationSpec>
If the validations fails, the ValidateComponent throws an FaultException
which will be catched by itself in
TransformComponentSupport:onMessageExchange. PojoSupport:fail gets called,
which sets the fault in the MessageExchange.
In the next call to ChainedComponent:invokeService the Status of
MessageExchange is only checked for ExchangeStatus.ERROR. Therefore the
ChainedComponent continues to invoke the next service in the chain, which
should not happen.
My second service in the ChainedComponent is a CopyTransformer. In my
context (and because of not stopping to invoke the services) the component
gets called with NULL for the IN message, causing a NULL pointer exception,
because the CopyTransformer doesn't check the parameter value for the IN
message. The CopyTransformer should check the parameters in
CopyTransformer:transform() and throw an exception, if NULL values are
passed in (or do nothing, if the from is NULL).
Kind regards
Juergen
--
View this message in context:
http://www.nabble.com/ChainedComponent-continues-invoking-services-after-failure-t1510668.html#a4097890
Sent from the ServiceMix - User forum at Nabble.com.