Sounds like you want to first split quotes.xml using a splitter, then
set a header containing the topic name, and finally send to a dynamic
recipient list routing on the header you just created.
So something like this (I haven't tried this, so you may need some small
edits :) )
from(uri="file=///c:/temp/quotes.xml").splitter(xpath("//price"))
.setHeader("stock").xpath("/price/@stock", String.class)
.setHeader("queueName").simple("jms:topic:STOCKS.${in.header.stock}")
.recipientList(header("queueName"));
cmoulliard wrote:
Hi,
I would like to know it this is possible to define dynamically the jms uri ?
I explain.
In a XML file, I have several lines, one by market symbol :
<price stock="MSFT" bid="2.008" offer=2.012" movement="2"/>
<price stock="SUNW" bid="1.34" offer="1.35" movement="2"/>
Depending on the stock name, I would like to send the line to a topic name
for which the name will be STOCKS.MSFT or STOCKS.SUNW or STOCKS.*. * means
that depending on the stock name, the stock name must be concatenated to the
topic STOCKS
from(uri="file=///c:/temp/quotes.xml")
.to(jms:topic:STOCKS.*)
KR,
Charles Moulliard
-----
Enterprise Architect
Xpectis
12, route d'Esch
L-1470 Luxembourg
Phone +352 25 10 70 470
Mobile +352 621 45 36 22
e-mail : [EMAIL PROTECTED]
web site : www.xpectis.com www.xpectis.com
My Blog : http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/