camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boday <>
Subject Re: Dynamic queue name from header property.
Date Sat, 07 Jul 2012 05:45:03 GMT
you shouldn't need to set/get the extra header value, you can also just do

    <from uri="activemq:IN.QUEUE?preserveMessageQos=true" />

dube wrote
> Hello
> I need to dynamically route my messages to queues using camel based off a
> header property.  I need to do this in a way where I can append the value
> of that header to a high level qualifier (HLQ) and have the message routed
> to that queue.  Understanding that I need to add some validation logic, 
> I've figured out a way to do this, but it seems kind of messy. Can someone
> tell me if there is a more direct way of accomplishing what I'm doing
> below?
> 		<route>
> 			<description>Example Camel Route</description>
> 			<from uri="activemq:IN.QUEUE?preserveMessageQos=true" />
> 			<setHeader headerName="FINAL_DESTINATION">
> 				<simple resultType="java.lang.String">
> activemq:queue:HLQ.${in.header.Q_NAME}
>                                 </simple>
> 			</setHeader>
> 			<recipientList delimiter=",">
> 				<header>FINAL_DESTINATION</header>
> 			</recipientList>
> 		</route>
> The result I would be expecting is that the producing application sets a
> JMS header property Q_NAME.  The route reads that and produces it to a
> queue named HLQ.<that value>.
> So if the header Q_NAME = OUTPUT.QUEUE then the message would be produced
> Thanks!

Ben O'Day
IT Consultant -

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message