Hi,
Content enricher seems like a good fit.

Cheers


On 09 Jan 2017 20:35, "sim085" <sim...@hotmail.com> wrote:

Hi Colin,

Thanks for your answer. I tried your example:

[code]
                from("seda:A")
                        .log("Hello From A")
                        .setHeader("MyHeader", constant("A-HEADER"))
                        .transform(constant("A-BODY"))
                        //.inOnly("seda:B")
                        .process(exchange ->
exchange.getContext().createProducerTemplate().sendBody("seda:B",
exchange.getIn().getBody()))
                        .log("MyHeader is ${in.header.MyHeader}")
                        .log("Body is ${body}")
                ;

                from("seda:B")
                        .log("Hello From B")
                        .setHeader("MyHeader", constant("B-HEADER"))
                        .transform(constant("B-BODY"))
                        .log("Ready from B")
                ;
[/code]

However this gives me the following:

[(camel-1) thread #0 - seda://A] route2                         INFO  Hello
>From A
[(camel-1) thread #1 - seda://B] route3                         INFO  Hello
>From B
[(camel-1) thread #0 - seda://A] route2                         INFO
MyHeader is A-HEADER
[(camel-1) thread #0 - seda://A] route2                         INFO  Body
is A-BODY
[(camel-1) thread #1 - seda://B] route3                         INFO  Ready
from B

If I add "?waitForTaskToComplete=Always" when calling "B" I get the correct
answer:

[(camel-1) thread #0 - seda://A] route2                         INFO  Hello
>From A
[(camel-1) thread #0 - seda://A] SedaEndpoint                   INFO
Endpoint Endpoint[seda://B?waitForTaskToComplete=Always] is using shared
queue: seda://B with size: 2147483647
[(camel-1) thread #1 - seda://B] route3                         INFO  Hello
>From B
[(camel-1) thread #1 - seda://B] route3                         INFO  Ready
from B
[(camel-1) thread #0 - seda://A] route2                         INFO
MyHeader is A-HEADER
[(camel-1) thread #0 - seda://A] route2                         INFO  Body
is A-BODY

So it looks that like that it works.

Likewise I would like to know if there are more "standard" options - if
any...



--
View this message in context: http://camel.465427.n5.nabble.
com/How-to-call-a-route-wait-to-finish-and-ignore-any-change
s-when-this-returns-tp5792288p5792331.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to