camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder (JIRA)" <>
Subject [jira] Commented: (CAMEL-3388) Strange bean annotation failure in Camel 2.5.0 & HEAD
Date Sun, 05 Dec 2010 00:13:10 GMT


Aaron Mulder commented on CAMEL-3388:

The problem seems to lie in Pipeline.createNextExchange

It looks like if you use @OutHeaders then you force an out message to be created, which means
in this pipeline method it will overwrite the in message (containing your bean return value)
with the out message (containing only headers).

I'm not sure what the appropriate resolution is.  If it's an InOnly exchange then it probably
doesn't make sense to overwrite the in message with the out message.

It seems like if you write to the out headers in a bean method you are trying to control what
headers are present in the message after the bean method invocation completes.  Perhaps if
it's an InOnly exchange then no out message should be generated by using @OutHeaders, it should
just supply a new empty map, and after the invocation has completed, replace the in headers
with the new map?

You might say that you shouldn't use @OutHeaders for an InOnly exchange, but in some cases
(JMS) you might not know whether it's an InOnly or InOut exchange just based on the route
definition, and it doesn't seem like you should need different bean methods and a content
based router that looks at the exchange pattern just because you always want to put some headers
into the output message.

> Strange bean annotation failure in Camel 2.5.0 & HEAD
> -----------------------------------------------------
>                 Key: CAMEL-3388
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.5.0
>            Reporter: Aaron Mulder
>            Priority: Critical
> When you invoke a bean with a method signature like this in Camel 2.5.0/HEAD, the in
and out message both are null (the "Hello!" value just disappears):
> {code:java}
>     public String doTest(@Body Object body, @Headers Map headers, @OutHeaders Map outHeaders)
>         return "Hello!";
>     }
> {code}
> The same thing without the headers works OK:
> {code:java}
>     public String doTest(@Body Object body) {
>         return "Hello!";
>     }
> {code}
> See camel-core/src/test/java/org/apache/camel/component/bean/

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message