I also have to deal with JBI errors. Suppose I am trying to send message from
app1 to app2, but my app2 is down. In this case I will get
"java.net.ConnectException: Connection refused" and the message status will
change to ERROR.
So my listener should handle both the cases.
If I use camel I have to tap messages from each and every path by explicitly
configuring it. If my applications go on increasing it will be difficult to
maintain.
Let me explain the flow in both the cases:
1)Listener will listen to all the messages on NMR
2)app1 sends message to app2 say <request><user>hello</user></request>
3)
Case1: app2 responds with success
The response is <response><status>success</status></response>
errorListener has nothing to do.
case2: app2 responds with error
The response is
<response><status>error</status><description>Invalid
user</description></response>
errorListener takes the "in" message
<request><message>hello</message></request> as well as "out" message from
app2
<response><status>error</status><description>InvalidUser</description></response>
append them and send message
<errorMessage><request><user>hello</user></request><response><status>error</status><description>Invalid
user</description></response></errorMessage>
to service " {http://servicemix.abc.com/samples/http}MyErrorHandlingService
"with endpoint "errorHandlerProviderEndpoint"
case3: app2 is DOWN
The message status will change to error. There will be error
message java.net.ConnectException: Connection refused on NMR.
Listener will get the "in" message as well as "error" message
"java.net.ConnectException: Connection refused" create a message like this
<errorMessage><request><user>hello</user></request><error><description>java.net.ConnectException:
Connection refused</description></rerror></errorMessage> to service "
{http://servicemix.abc.com/samples/http}MyErrorHandlingService "with
endpoint "errorHandlerProviderEndpoint"
i am done with creating the messages that I have to send to the
errorhandling service in string format. I am stuck on how to send them to
ErrorHandlingService
How can I send message like this
whic<errorMessage><request><user>hello</user></request><error><description>java.net.ConnectException:
Connection refused</description></rerror></errorMessage>
which is in string format to ErrorHandlingService?
--
View this message in context:
http://www.nabble.com/How-to-route-message-from-a-listener--tp17483625p17528001.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.