camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAMEL-11670) Camel Aggregator strategy Exchange- java.lang.ClassCastException - org.apache.camel.impl.DefaultMessage cannot be cast to org.apache.camel.component.jms.JmsMessage
Date Tue, 22 Aug 2017 00:36:04 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-11670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16136071#comment-16136071
] 

Claus Ibsen edited comment on CAMEL-11670 at 8/22/17 12:35 AM:
---------------------------------------------------------------

No we dont want to do that really. Sorry for the short answer.

A problem is that the aggregation may return the incoming exchange and use that as response,
which runs independent of the incoming request. Therefore you may "leak abstractions", eg
the jms message was from incoming, but copied over to response, and they run independently.


The safe copy prevents that. 

So what is it that you need from the JMS message in your aggregation strategy? The camel message
should have all the standard details already such as JMS headers and body etc.

Avoid using that type cast in your agg strategy code if you can.


was (Author: davsclaus):
No we dont want to do that.

> Camel Aggregator strategy Exchange- java.lang.ClassCastException - org.apache.camel.impl.DefaultMessage
cannot be cast to org.apache.camel.component.jms.JmsMessage
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-11670
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11670
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.18.0
>            Reporter: Rajithamol Lakshmanan
>            Assignee: Claus Ibsen
>
> I am using camel-aggregator for aggregating JMS messages. When I upgraded the camel version
from 2.15.6 to 2.18.0 I started getting ClassCastException  in the aggregatorstrategy class.

> Error occurred during aggregation. Exchange[]. Caused by: [java.lang.ClassCastException
- org.apache.camel.impl.DefaultMessage cannot be cast to org.apache.camel.component.jms.JmsMessage].

> I debugged and found that AggregatorProcessor calls ExchangeHelper.createCorrelatedCopy
which copies the exchange harcoding the safeMode to be true. 
> In 2.18.0 : Exchange copy = exchange.copy(true); 
> In 2.15.6 : Exchange copy = exchange.copy(); 
> Because of this we are not getting the original JMS message- javax.jms.Message inside
org.apache.camel.Message .
> Can we have an option to configure this deep copy option?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message