you shouldn't need to set/get the extra header value, you can also just do this...
<route> <from uri="activemq:IN.QUEUE?preserveMessageQos=true" /> <recipientList> <simple>activemq:queue:HLQ.${in.header.Q_NAME}</simple> </recipientList> </route> 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 > to HLQ.OUTPUT.QUEUE > > Thanks! > ----- Ben O'Day IT Consultant -http://consulting-notes.com -- View this message in context: http://camel.465427.n5.nabble.com/Dynamic-queue-name-from-header-property-tp5715644p5715645.html Sent from the Camel - Users mailing list archive at Nabble.com.