Hello there!
I'm using Jboss ESB 4.10 and read a lot about exception handling and how it is done by now.
I know that a custom composer class can be defined for my gateway (which receives ESB-unaware messages) and in that custom composer I can set the faultTo of the call.
The problem is that the posts I read about this topic are mainly 3-4 years old and I'm afraid they are quite outdated since when I try to assign a custom composer to my JMS listener in the mentioned way, it simply runs to validation error during deployment.
So the JMS listener definition looks like this (its a working esb without the property custom composer of course)
<jms-listener busidref="omitted_for_security_reasonsl" is-gateway="true" name="omitted_for_security_reasons">
<jms-message-filter dest-name="omitted_for_security_reasons" dest-type="QUEUE" transacted="false"/>
<property name="composer-class" value="MyMessageComposer"></property>
</jms-listener>
And the validation error message which i got from eclipse (the later one during deployment is not too talkative)
"cvc-complex-type.2.4.d: Invalid content was found starting with element 'property'. No child element is expected at this point."
The MyMessageComposer looks like this:
public class MyMessageComposer extends AbstractMessageComposer<Object> {
@Override
protected void populateMessage(Message message, Object payload)
throws MessageDeliverException {
System.out.println("Payload is :" + payload.toString());
message.getBody().add(payload);
}
}
For a possible solution I could think about creating a proxy service which connects to the gateway and in a custom action does nothing but setting faultTo of the call and then invokes the service I'm in trouble with now, but this sounds like a little bit of hack to me.
Please explain me the workaround for the exception handling with the custom message composer approach and also some opinion about the proxy service idea would be nice.
Thanks a lot in advance!
Regards,
Peter