I have a following message flow:
public void configure() {
        errorHandler(deadLetterChannel(
                
"jbi:service:http://servicemix.in2m.com/samples/http/bean1Service";)
        
.maximumRedeliveries(5).initialRedeliveryDelay(60000).backOffMultiplier(2.0));

    
from("jbi:service:http://servicemix.in2m.com/samples/http/httpConsumer";)
           
.to("jbi:service:http://servicemix.in2m.com/samples/http/MyProviderService";)
           
.to("jbi:service:http://servicemix.in2m.com/samples/http/bean2Service";);
    }
1) I consume a message from httpConsumer and send it to myproviderservice.
2)If myproviderservice is up and running it sends some response.
3) Based 0n the response sent by myproviderservice, bean2service creates a
custom message and sends back to the client. and everything goes fine.
4)If my myproviderservice is not up i get java.net.ConnectException. I don't
want to send this excetion and stacktrace to the client. i want to send
suppose a message <error>Internal Error<error> to the client.  How can I do
that? 
In this case my bean2service never comes into the whole flow. Is there a way
to say that whatever happens to my message flow, my bean2service should
always be invoked before sending the response to the client? 
Or is there any other way to do it?

Please help.
Pratibha
-- 
View this message in context: 
http://www.nabble.com/How-to-send-a-custom-message-to-the-client-in-case-of-error-tp18127324p18127324.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to