Claus
Per your suggestion, I tried setting in XML as follows, but it still does
not work. The only properties I am seeing on the exchange where I was trying
to get the JMSCorrelationID were CamelBinding and CamelExceptionCaught.
<setProperty propertyName="JMSCorrelationID">
<simple>${header.JMSCorrelationID}</simple>
</setProperty>
Do you have any other suggestions that I might try?
By the way, I get the following exception and think it may be related:
2011-09-16 11:02:01,046 | TRACE | onMessage.process END |
org.apache.camel.component.jms.EndpointMessageListener |
DefaultMessageListenerContainer-1
2011-09-16 11:02:01,046 | ERROR | Caused by:
[org.apache.camel.RuntimeCamelException - java.lang.ClassCastException:
org.apache.camel.impl.DefaultMessage cannot be cast to
org.apache.camel.component.jms.JmsMessage] |
org.apache.camel.component.jms.EndpointMessageListener |
DefaultMessageListenerContainer-1
org.apache.camel.RuntimeCamelException: java.lang.ClassCastException:
org.apache.camel.impl.DefaultMessage cannot be cast to
org.apache.camel.component.jms.JmsMessage
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1126)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:133)
On Mon, Sep 12, 2011 at 1:53 AM, Claus Ibsen-2 [via Camel] <
[email protected]> wrote:
> Hi
>
> You can try storing that JMSCorrelationID as a property directly on
> the Exchange instead of the Message.
> Then it ought to be kept safe.
>
> exchange.setProperty("xxx", value);
>
>
> On Tue, Sep 6, 2011 at 6:25 PM, pkleczka <[hidden
> email]<http://user/SendEmail.jtp?type=node&node=4793418&i=0>>
> wrote:
>
> > Hello
> >
> > *Problem*: When an incoming message arrives in my queue, I copy the
> message
> > ID into the JMSCorrelationID on header before routing to other internal
> > queues. When my exception handling engages, the property disappears.
> >
> > Below is the method signature for the bean I am calling when the
> exception
> > happens:
> > *public String transform(String message)*
> >
> > Below is the XML for my route:
> >
> >
> > In my exception handler, I call a bean to "wrap" the original message in
> > some additional XML (including my JMSCorrelationID). The signature for
> that
> > method is:
> > *public void respond(Exchange exchange, Exception exception)*
> >
> > In that method, I pull the JMSCorrelationID as follows:
> > *exchange.getIn().getHeader("JMSCorrelationID");*
> >
> > In another error handler, that uses a try/catch block, I get back a
> non-null
> > JMSCorrelationID. I am at a loss as to why I am getting a null on the
> > onException handler. Any pointers are appreciated.
> >
> > Thanks,
> > Peter
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Missing-properties-on-exception-tp4775029p4775029.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=4793418&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Missing-properties-on-exception-tp4775029p4793418.html
> To unsubscribe from Missing properties on exception, click
> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4775029&code=cGtsZWN6a2FAZ21haWwuY29tfDQ3NzUwMjl8OTY3NjE0OTg2>.
>
>
--
View this message in context:
http://camel.465427.n5.nabble.com/Missing-properties-on-exception-tp4775029p4811682.html
Sent from the Camel - Users mailing list archive at Nabble.com.