camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjay Bhattacharya <san...@gmail.com>
Subject Re: How to retrieve the Exchange from onMessage of an MDB
Date Tue, 14 Jan 2014 07:53:38 GMT
Instead of an MDB, you can use a bean to process the message.
<from uri="jms:inQueue"/>
<to uri="bean:mdbBean?method=processMessage"/>
...
And you can define processMessage as:
public void processMessage(String body, Exchange exchange) {

try {
//do your stuff
} catch(Exception e) {
exchange.getContext().stopRoute("yourRouteId");
}

Thanks,
Sanjay



On Tue, Jan 14, 2014 at 5:14 AM, hooty223 <hooty223@gmail.com> wrote:

> I have an MDB that calls a function when an error occurs (program errors
> and
> not Runtime). When this occurs I would like to stop the route. How can I do
> this since the Exchange is not available on the onMessage(Message message)
> call.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-retrieve-the-Exchange-from-onMessage-of-an-MDB-tp5745913.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message