You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Blair <bl...@gmail.com> on 2011/01/16 23:42:19 UTC

one last ugly hack I want to remove.

I have one last line in my camel project which is just a world of ugly
hackery I want to get around, but I can't find a good way around it.

from("cxf:bean:privateMessageService").routeId("ws-privateQueue").transacted().split().body().inOnly("activemq:pmQueue").end().transform(constant(new
ReceiveNotificationResponse()));

The split does nothing, but... I can't seem to be able to remove it.

if I use 
.transacted().inOnly("activemq:pmQueue").transform(constant(new
ReceiveNotificationResponse()));

then its like the transform doesn't happen, and a empty message is replied.

if I use
.transacted().to("activemq:pmQueue").transform(constant(new
ReceiveNotificationResponse()));

Then it waits for activeMQ, and times out.

if I run the transform first, then activeMQ places the transformed object on
the queue, even when I say inOnly.

I CAN use a wiretap to do this, or write my own processor, but I know it
should be less hacky then this.

Weirdly enough, replacing activemq:* with log:* means it works. So I'm still
not quite getting something here.


-- 
View this message in context: http://camel.465427.n5.nabble.com/one-last-ugly-hack-I-want-to-remove-tp3343759p3343759.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: one last ugly hack I want to remove.

Posted by Blair <bl...@gmail.com>.
Sweet, I thought I had tried that...

but obviously not... as it works just fine :)

thanks for that!
-- 
View this message in context: http://camel.465427.n5.nabble.com/one-last-ugly-hack-I-want-to-remove-tp3343759p3345116.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: one last ugly hack I want to remove.

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You need to set the Message exchange pattern back to InOut before 
transformer, as transformer just set the exchange out message and don't 
care about the message exchange pattern.

Willem

On 1/17/11 6:42 AM, Blair wrote:
>
> I have one last line in my camel project which is just a world of ugly
> hackery I want to get around, but I can't find a good way around it.
>
> from("cxf:bean:privateMessageService").routeId("ws-privateQueue").transacted().split().body().inOnly("activemq:pmQueue").end().transform(constant(new
> ReceiveNotificationResponse()));
>
> The split does nothing, but... I can't seem to be able to remove it.
>
> if I use
> .transacted().inOnly("activemq:pmQueue").transform(constant(new
> ReceiveNotificationResponse()));
>
> then its like the transform doesn't happen, and a empty message is replied.
>
> if I use
> .transacted().to("activemq:pmQueue").transform(constant(new
> ReceiveNotificationResponse()));
>
> Then it waits for activeMQ, and times out.
>
> if I run the transform first, then activeMQ places the transformed object on
> the queue, even when I say inOnly.
>
> I CAN use a wiretap to do this, or write my own processor, but I know it
> should be less hacky then this.
>
> Weirdly enough, replacing activemq:* with log:* means it works. So I'm still
> not quite getting something here.
>
>

----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang