camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xuan Huang <Xuan.Hu...@Gamesys.co.uk>
Subject using MessageConverter with Bean
Date Thu, 22 Mar 2012 16:08:29 GMT
Hi,

I have in my RouteBuilder something like this:

public class MyRouteBuilder extends RouteBuilder{
private static final String IN_QUEUE="activemq:myqueue.in?messageConverter=#myMessageConverter";

@Override
public void configure(){
	from(IN_QUEUE).choice()
	.when(header("JMSType").isEqualTo("CommandType"))
	.inOut("bean:messageListener?method=handleMessage")
	.otherwise().to("activemq:myqueue.in.DLQ")
	.routeId("jms-my-route");
}

}

The handleMessage method in MessageListener processes the input and generates a POJO which
is set to the message body, but the Type in the JMS header is not set to the proper return
type. What is the proper way of setting the message converter for the reply message?

Regards,
xuan
Mime
View raw message