You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cmoulliard <cm...@gmail.com> on 2008/10/20 15:54:44 UTC

How to define dynamically the jms uri ?

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 : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20067678.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
Many thanks for your help. It works like this.
:super:

Ivan Stojic wrote:
> 
> 
> cmoulliard wrote:
>> 
>> Can someone tell me why only one message of the six splitted is processed
>> by the recipient (see my previous post where the log has been added) ? Is
>> it an issue with the Recipient or the combination of splitter + recipient
>> + spring ?
>> 
> 
> You should use the recipientList inside the splitter, not after:
> 
> <splitter>
>   <xpath>//price</xpath>
>   <setHeader headerName="stock"><xpath>//price/@stock</xpath></setHeader>
>  
> <recipientList><simple>jms:topic:STOCK.${in.header.stock}</simple></recipientList> 
> </splitter>
> 
> Regards,
> Ivan
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20107105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by Ivan Stojic <iv...@gmail.com>.

cmoulliard wrote:
> 
> Can someone tell me why only one message of the six splitted is processed
> by the recipient (see my previous post where the log has been added) ? Is
> it an issue with the Recipient or the combination of splitter + recipient
> + spring ?
> 

You should use the recipientList inside the splitter, not after:

<splitter>
  <xpath>//price</xpath>
  <setHeader headerName="stock"><xpath>//price/@stock</xpath></setHeader>
 
<recipientList><simple>jms:topic:STOCK.${in.header.stock}</simple></recipientList> 
</splitter>

Regards,
Ivan
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20106669.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
Can someone tell me why only one message of the six splitted is processed by
the recipient (see my previous post where the log has been added) ? Is it an
issue with the Recipient or the combination of splitter + recipient + spring
?

KR,

Charles


cmoulliard wrote:
> 
> I hope so ...
> 
> Here is the trace which is not really conclusive because we only see :
> 
> setHeader(//price/@stock)
> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: ->
> interceptor(Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Splitter[xpath{//priceXPath:
> //price} -> [SetHeader[stock, xpath{//price/@stockXPath: //price/@stock}],
> SetHeader[queueName,
> simple{jms:topic:STOCK.${in.header.stock}jms:topic:STOCK.${in.header.stock}}]]]]),
> RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
> DeadLetterChannel[Delegate(TraceInterceptor[RecipientList[header{queueNameheader(queueName)}]]),
> RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]]])) ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{CamelFileLastModified=Tue Oct 21 14:06:50 CEST 2008,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=512,
> CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<?xml version="1.0"
> encoding="ISO-8859-1"?>
> <quotes>
> <price stock="MSFT" bid="2.008" offer="2.012" movement="up"/>
> <price stock="SUNW" bid="1.034" offer="1.035" movement="down"/>
> <price stock="IBMW" bid="2.008" offer="2.012" movement="up"/>
> <price stock="DEXI" bid="1.456" offer="1.035" movement="up"/> 
> <price stock="INGB" bid="1.078" offer="1.035" movement="down"/>
> <price stock="KBCB" bid="4.234" offer="1.035" movement="down"/>
> <price stock="COLR" bid="6.123" offer="1.035" movement="up"/>
> </quotes> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> splitter(//price)         , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{CamelFileLastModified=Tue Oct 21 14:06:50 CEST 2008,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=512,
> CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<?xml version="1.0"
> encoding="ISO-8859-1"?>
> <quotes>
> <price stock="MSFT" bid="2.008" offer="2.012" movement="up"/>
> <price stock="SUNW" bid="1.034" offer="1.035" movement="down"/>
> <price stock="IBMW" bid="2.008" offer="2.012" movement="up"/>
> <price stock="DEXI" bid="1.456" offer="1.035" movement="up"/> 
> <price stock="INGB" bid="1.078" offer="1.035" movement="down"/>
> <price stock="KBCB" bid="4.234" offer="1.035" movement="down"/>
> <price stock="COLR" bid="6.123" offer="1.035" movement="up"/>
> </quotes> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=0, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="2.008"
> movement="up" offer="2.012" stock="MSFT"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@fafd42,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=0, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="2.008" movement="up" offer="2.012" stock="MSFT"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=1, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.034"
> movement="down" offer="1.035" stock="SUNW"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@1f21056,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=1, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="1.034" movement="down" offer="1.035" stock="SUNW"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=2, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="2.008"
> movement="up" offer="2.012" stock="IBMW"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@91cf0b,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=2, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="2.008" movement="up" offer="2.012" stock="IBMW"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=3, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.456"
> movement="up" offer="1.035" stock="DEXI"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@b00ec2,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=3, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="1.456" movement="up" offer="1.035" stock="DEXI"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=4, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.078"
> movement="down" offer="1.035" stock="INGB"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@18e8fe0,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=4, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="1.078" movement="down" offer="1.035" stock="INGB"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="4.234"
> movement="down" offer="1.035" stock="KBCB"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@fbbbc,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=5, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="4.234" movement="down" offer="1.035" stock="KBCB"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=512,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=6, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , Body:<price bid="6.123"
> movement="up" offer="1.035" stock="COLR"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@123defe,
> CamelFileLength=512, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=6, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="6.123" movement="up" offer="1.035" stock="COLR"/> 
> 21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
> GRAVE: -> recipientList(queueName)  , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
> 14:06:50 CEST 2008,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@123defe,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
> CamelFileLength=512, CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=6, CamelFileParent=d:\temp\quotes,
> queueName=jms:topic:STOCK.COLR, org.apache.camel.file.name=quotes.xml} ,
> Body:<price bid="6.123" movement="up" offer="1.035" stock="COLR"/> 
> 21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService start
> INFO: Using Persistence Adapter: MemoryPersistenceAdapter
> 21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService getBroker
> INFO: ActiveMQ 5.1.0 JMS Message Broker (localhost) is starting
> 21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService getBroker
> INFO: For help or more information please see: http://activemq.apache.org/
> 21-oct.-2008 14:32:16 org.apache.activemq.broker.jmx.ManagementContext$1
> run
> INFO: JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> 21-oct.-2008 14:32:17 org.apache.activemq.broker.BrokerService start
> INFO: ActiveMQ JMS Message Broker (localhost,
> ID:dell-charles-1742-1224592336890-0:0) started
> 21-oct.-2008 14:32:17 org.apache.activemq.broker.TransportConnector start
> INFO: Connector vm://localhost Started
> 
> 
> James.Strachan wrote:
>> 
>> And you are sure the headers are being set to create different stocks
>> right? (Use the tracer to see them?)
>> 
>> 
>> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>>
>>> Idem. Only one topic is created (STOCK.BEAS).
>>>
>>>
>>> James.Strachan wrote:
>>>>
>>>> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>>>>
>>>>> James,
>>>>>
>>>>> What do you mean by "It looks like the issue is the carriage return at
>>>>> the
>>>>> end of the queue
>>>>> name; if you remove that it should be fine." ? I don't understand
>>>>>
>>>>> Remark : there is one error in my route definition
>>>>>
>>>>> <simple>"jms:topic:STOCK.${in.header.stock}
>>>>>
>>>>> -->
>>>>>
>>>>> <simple>jms:topic:STOCK.${in.header.stock}</simple>
>>>>
>>>> Yes thats it. Whats the stack trace if you remove that whitespace at
>>>> the end of the URI?
>>>>
>>>> --
>>>> James
>>>> -------
>>>> http://macstrac.blogspot.com/
>>>>
>>>> Open Source Integration
>>>> http://fusesource.com/
>>>>
>>>>
>>>
>>>
>>> -----
>>> Enterprise Architect
>>>
>>> Xpectis
>>> 12, route d'Esch
>>> L-1470 Luxembourg
>>>
>>> Phone +352 25 10 70 470
>>> Mobile +352 621 45 36 22
>>>
>>> e-mail : cmoulliard@xpectis.com
>>> web site :  www.xpectis.com www.xpectis.com
>>> My Blog :  http://cmoulliard.blogspot.com/
>>> http://cmoulliard.blogspot.com/
>>> --
>>> View this message in context:
>>> http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20088925.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> James
>> -------
>> http://macstrac.blogspot.com/
>> 
>> Open Source Integration
>> http://fusesource.com/
>> 
>> 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20105027.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
I hope so ...

Here is the trace which is not really conclusive because we only see :

setHeader(//price/@stock)

21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: ->
interceptor(Delegate(Pipeline[DeadLetterChannel[Delegate(TraceInterceptor[Splitter[xpath{//priceXPath:
//price} -> [SetHeader[stock, xpath{//price/@stockXPath: //price/@stock}],
SetHeader[queueName,
simple{jms:topic:STOCK.${in.header.stock}jms:topic:STOCK.${in.header.stock}}]]]]),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]],
DeadLetterChannel[Delegate(TraceInterceptor[RecipientList[header{queueNameheader(queueName)}]]),
RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]]])) ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{CamelFileLastModified=Tue Oct 21 14:06:50 CEST 2008,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=512,
CamelFileName=quotes.xml, CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<?xml version="1.0"
encoding="ISO-8859-1"?>
<quotes>
<price stock="MSFT" bid="2.008" offer="2.012" movement="up"/>
<price stock="SUNW" bid="1.034" offer="1.035" movement="down"/>
<price stock="IBMW" bid="2.008" offer="2.012" movement="up"/>
<price stock="DEXI" bid="1.456" offer="1.035" movement="up"/> 
<price stock="INGB" bid="1.078" offer="1.035" movement="down"/>
<price stock="KBCB" bid="4.234" offer="1.035" movement="down"/>
<price stock="COLR" bid="6.123" offer="1.035" movement="up"/>
</quotes> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> splitter(//price)         , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{CamelFileLastModified=Tue Oct 21 14:06:50 CEST 2008,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=512,
CamelFileName=quotes.xml, CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<?xml version="1.0"
encoding="ISO-8859-1"?>
<quotes>
<price stock="MSFT" bid="2.008" offer="2.012" movement="up"/>
<price stock="SUNW" bid="1.034" offer="1.035" movement="down"/>
<price stock="IBMW" bid="2.008" offer="2.012" movement="up"/>
<price stock="DEXI" bid="1.456" offer="1.035" movement="up"/> 
<price stock="INGB" bid="1.078" offer="1.035" movement="down"/>
<price stock="KBCB" bid="4.234" offer="1.035" movement="down"/>
<price stock="COLR" bid="6.123" offer="1.035" movement="up"/>
</quotes> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=0, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="2.008"
movement="up" offer="2.012" stock="MSFT"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@fafd42,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=0, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="2.008" movement="up" offer="2.012" stock="MSFT"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=1, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.034"
movement="down" offer="1.035" stock="SUNW"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@1f21056,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=1, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="1.034" movement="down" offer="1.035" stock="SUNW"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=2, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="2.008"
movement="up" offer="2.012" stock="IBMW"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@91cf0b,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=2, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="2.008" movement="up" offer="2.012" stock="IBMW"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=3, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.456"
movement="up" offer="1.035" stock="DEXI"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@b00ec2,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=3, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="1.456" movement="up" offer="1.035" stock="DEXI"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=4, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="1.078"
movement="down" offer="1.035" stock="INGB"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@18e8fe0,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=4, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="1.078" movement="down" offer="1.035" stock="INGB"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="4.234"
movement="down" offer="1.035" stock="KBCB"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@fbbbc,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=5, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="4.234" movement="down" offer="1.035" stock="KBCB"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(//price/@stock) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=512,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=6, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , Body:<price bid="6.123"
movement="up" offer="1.035" stock="COLR"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> setHeader(jms:topic:STOCK.${in.header.stock}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@123defe,
CamelFileLength=512, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=6, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="6.123" movement="up" offer="1.035" stock="COLR"/> 
21-oct.-2008 14:32:16 org.apache.camel.processor.Logger process
GRAVE: -> recipientList(queueName)  , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=7, CamelFileLastModified=Tue Oct 21
14:06:50 CEST 2008,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@123defe,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
CamelFileLength=512, CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=6, CamelFileParent=d:\temp\quotes,
queueName=jms:topic:STOCK.COLR, org.apache.camel.file.name=quotes.xml} ,
Body:<price bid="6.123" movement="up" offer="1.035" stock="COLR"/> 
21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService start
INFO: Using Persistence Adapter: MemoryPersistenceAdapter
21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService getBroker
INFO: ActiveMQ 5.1.0 JMS Message Broker (localhost) is starting
21-oct.-2008 14:32:16 org.apache.activemq.broker.BrokerService getBroker
INFO: For help or more information please see: http://activemq.apache.org/
21-oct.-2008 14:32:16 org.apache.activemq.broker.jmx.ManagementContext$1 run
INFO: JMX consoles can connect to
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
21-oct.-2008 14:32:17 org.apache.activemq.broker.BrokerService start
INFO: ActiveMQ JMS Message Broker (localhost,
ID:dell-charles-1742-1224592336890-0:0) started
21-oct.-2008 14:32:17 org.apache.activemq.broker.TransportConnector start
INFO: Connector vm://localhost Started


James.Strachan wrote:
> 
> And you are sure the headers are being set to create different stocks
> right? (Use the tracer to see them?)
> 
> 
> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>
>> Idem. Only one topic is created (STOCK.BEAS).
>>
>>
>> James.Strachan wrote:
>>>
>>> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>>>
>>>> James,
>>>>
>>>> What do you mean by "It looks like the issue is the carriage return at
>>>> the
>>>> end of the queue
>>>> name; if you remove that it should be fine." ? I don't understand
>>>>
>>>> Remark : there is one error in my route definition
>>>>
>>>> <simple>"jms:topic:STOCK.${in.header.stock}
>>>>
>>>> -->
>>>>
>>>> <simple>jms:topic:STOCK.${in.header.stock}</simple>
>>>
>>> Yes thats it. Whats the stack trace if you remove that whitespace at
>>> the end of the URI?
>>>
>>> --
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>>
>>> Open Source Integration
>>> http://fusesource.com/
>>>
>>>
>>
>>
>> -----
>> Enterprise Architect
>>
>> Xpectis
>> 12, route d'Esch
>> L-1470 Luxembourg
>>
>> Phone +352 25 10 70 470
>> Mobile +352 621 45 36 22
>>
>> e-mail : cmoulliard@xpectis.com
>> web site :  www.xpectis.com www.xpectis.com
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20088925.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20089201.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by James Strachan <ja...@gmail.com>.
And you are sure the headers are being set to create different stocks
right? (Use the tracer to see them?)


2008/10/21 cmoulliard <cm...@gmail.com>:
>
> Idem. Only one topic is created (STOCK.BEAS).
>
>
> James.Strachan wrote:
>>
>> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>>
>>> James,
>>>
>>> What do you mean by "It looks like the issue is the carriage return at
>>> the
>>> end of the queue
>>> name; if you remove that it should be fine." ? I don't understand
>>>
>>> Remark : there is one error in my route definition
>>>
>>> <simple>"jms:topic:STOCK.${in.header.stock}
>>>
>>> -->
>>>
>>> <simple>jms:topic:STOCK.${in.header.stock}</simple>
>>
>> Yes thats it. Whats the stack trace if you remove that whitespace at
>> the end of the URI?
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source Integration
>> http://fusesource.com/
>>
>>
>
>
> -----
> Enterprise Architect
>
> Xpectis
> 12, route d'Esch
> L-1470 Luxembourg
>
> Phone +352 25 10 70 470
> Mobile +352 621 45 36 22
>
> e-mail : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20088925.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
Idem. Only one topic is created (STOCK.BEAS).


James.Strachan wrote:
> 
> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>
>> James,
>>
>> What do you mean by "It looks like the issue is the carriage return at
>> the
>> end of the queue
>> name; if you remove that it should be fine." ? I don't understand
>>
>> Remark : there is one error in my route definition
>>
>> <simple>"jms:topic:STOCK.${in.header.stock}
>>
>> -->
>>
>> <simple>jms:topic:STOCK.${in.header.stock}</simple>
> 
> Yes thats it. Whats the stack trace if you remove that whitespace at
> the end of the URI?
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20088925.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by James Strachan <ja...@gmail.com>.
2008/10/21 cmoulliard <cm...@gmail.com>:
>
> James,
>
> What do you mean by "It looks like the issue is the carriage return at the
> end of the queue
> name; if you remove that it should be fine." ? I don't understand
>
> Remark : there is one error in my route definition
>
> <simple>"jms:topic:STOCK.${in.header.stock}
>
> -->
>
> <simple>jms:topic:STOCK.${in.header.stock}</simple>

Yes thats it. Whats the stack trace if you remove that whitespace at
the end of the URI?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
James,

What do you mean by "It looks like the issue is the carriage return at the
end of the queue
name; if you remove that it should be fine." ? I don't understand

Remark : there is one error in my route definition 

<simple>"jms:topic:STOCK.${in.header.stock}

-->

<simple>jms:topic:STOCK.${in.header.stock}</simple>


James.Strachan wrote:
> 
> It looks like the issue is the carriage return at the end of the queue
> name; if you remove that it should be fine.
> 
> (We should probably patch the getEndpoint() method in Camel to trim
> the URL first)
> 
> 
> 2008/10/21 cmoulliard <cm...@gmail.com>:
>>
>> Many thanks for your help.
>>
>> I try to implement what you propose bu I receive on the console the
>> following error "No endpoint could be found for : "jms:topic:STOCK.BEAS"
>>
>> Remark : BEAS is a stock name.
>>
>> Here is my code and the log generated :
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:context="http://www.springframework.org/schema/context"
>>        xsi:schemaLocation="
>>       http://www.springframework.org/schema/beans
>>       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>>       http://www.springframework.org/schema/context
>>      
>> http://www.springframework.org/schema/context/spring-context-2.5.xsd
>>       http://activemq.apache.org/camel/schema/spring
>>       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>>
>>        <!--  ActiveMQ brokerURL using VM protocol -->
>>        <bean id="jms"
>> class="org.apache.activemq.camel.component.ActiveMQComponent">
>>                <property name="brokerURL"
>> value="vm://localhost:61616?broker.persistent=false" />
>>        </bean>
>>
>>        <bean id="camelTracer"
>> class="org.apache.camel.processor.interceptor.Tracer">
>>                <property name="traceExceptions" value="false" />
>>                <property name="traceInterceptors" value="true" />
>>                <property name="logLevel" value="FATAL" />
>>                <property name="logName" value="com.xpectis.tracker" />
>>        </bean>
>>
>>        <bean id="traceFormatter"
>> class="org.apache.camel.processor.interceptor.TraceFormatter">
>>                <property name="showBody" value="true" />
>>                <property name="showHeader" value="true" />
>>                <property name="showBodyType" value="false" />
>>                <property name="showBreadCrumb" value="false" />
>>        </bean>
>>
>>        <camelContext id="camel" trace="true"
>>                xmlns="http://activemq.apache.org/camel/schema/spring">
>>                <jmxAgent id="agent" createConnector="true" />
>>                <route>
>>                        <from uri="file:///d:/temp/quotes/?delete=false"
>> />
>>                        <splitter>
>>                                <xpath>//price</xpath>
>>                                <setHeader headerName="stock">
>>                                        <xpath>//price/@stock</xpath>
>>                                </setHeader>
>>                                <setHeader headerName="queueName">
>>                                       
>> <simple>"jms:topic:STOCK.${in.header.stock}
>>                                        </simple>
>>                                </setHeader>
>>                        </splitter>
>>                        <recipientList>
>>                                <header>queueName</header>
>>                        </recipientList>
>>                </route>
>>        </camelContext>
>> </beans>
>>
>> log :
>>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> splitter(//price)        
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{CamelFileLastModified=Mon Oct 20 16:39:16 CEST 2008,
>> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=437,
>> CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} , BodyType:java.io.File ,
>> Body:<?xml
>> version="1.0" encoding="ISO-8859-1"?>
>> <quotes>
>> <price stock="MSFT" bid="2.008" offer="2.012" movement="2"/>
>> <price stock="SUNW" bid="1.034" offer="1.035" movement="2"/>
>> <price stock="IBMW" bid="2.008" offer="2.012" movement="2"/>
>> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
>> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
>> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
>> </quotes>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=0, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@489c42,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=0, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=1, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@9b774e,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=1, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=2, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@8210fc,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=2, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=3, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@1292738,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=3, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=4, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@16f2067,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=4, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock) 
>> ,
>> Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml, CamelFileLength=437,
>> CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> setHeader("jms:topic:STOCK.${in.header.stock}
>>                                        ) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
>> CamelFileLength=437, CamelFileName=quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
>> org.apache.camel.splitCounter=5, org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> recipientList(${in.header.queueName}) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
>> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml,
>> CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
>> queueName="jms:topic:STOCK.BEAS
>>                                        ,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
>> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
>> recipientList(${in.header.queueName}) , Pattern:InOnly ,
>> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
>> exclusive valid],
>> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
>> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
>> 16:39:16 CEST 2008,
>> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
>> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
>> CamelFileName=quotes.xml,
>> CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
>> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
>> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
>> queueName="jms:topic:STOCK.BEAS
>>                                        ,
>> org.apache.camel.file.name=quotes.xml} ,
>> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
>> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
>> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
>> "jms:topic:STOCK.BEAS
>>                                        , please check your classpath
>> contains the needed camel component jar.
>>        at
>> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
>>        at
>> org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:86)
>>        at
>> org.apache.camel.processor.RecipientList.resolveEndpoint(RecipientList.java:79)
>>        at
>> org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:70)
>>        at
>> org.apache.camel.processor.RecipientList.process(RecipientList.java:59)
>>        at
>> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
>>        at
>> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
>>        at
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:75)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:90)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
>>        at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:50)
>>        at
>> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
>>        at
>> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
>>        at
>> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
>>        at
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
>>        at
>> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:153)
>>        at
>> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:89)
>>        at
>> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:99)
>>        at
>> org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:65)
>>        at
>> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>>        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
>> Source)
>>        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown
>> Source)
>>        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
>>        at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown
>> Source)
>>        at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown
>> Source)
>>        at
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
>> Source)
>>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
>> Source)
>>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
>> Source)
>>        at java.lang.Thread.run(Unknown Source)
>> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger log
>>
>> KR,
>>
>> Charles Moulliard
>>
>>
>> janstey wrote:
>>>
>>> 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 : cmoulliard@xpectis.com
>>>> web site :  www.xpectis.com www.xpectis.com
>>>> My Blog :  http://cmoulliard.blogspot.com/
>>>> http://cmoulliard.blogspot.com/
>>>>
>>>
>>>
>>>
>>
>>
>> -----
>> Enterprise Architect
>>
>> Xpectis
>> 12, route d'Esch
>> L-1470 Luxembourg
>>
>> Phone +352 25 10 70 470
>> Mobile +352 621 45 36 22
>>
>> e-mail : cmoulliard@xpectis.com
>> web site :  www.xpectis.com www.xpectis.com
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20086157.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20088844.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by James Strachan <ja...@gmail.com>.
It looks like the issue is the carriage return at the end of the queue
name; if you remove that it should be fine.

(We should probably patch the getEndpoint() method in Camel to trim
the URL first)


2008/10/21 cmoulliard <cm...@gmail.com>:
>
> Many thanks for your help.
>
> I try to implement what you propose bu I receive on the console the
> following error "No endpoint could be found for : "jms:topic:STOCK.BEAS"
>
> Remark : BEAS is a stock name.
>
> Here is my code and the log generated :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:context="http://www.springframework.org/schema/context"
>        xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
>       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>       http://www.springframework.org/schema/context
>       http://www.springframework.org/schema/context/spring-context-2.5.xsd
>       http://activemq.apache.org/camel/schema/spring
>       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
>
>        <!--  ActiveMQ brokerURL using VM protocol -->
>        <bean id="jms"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>                <property name="brokerURL"
> value="vm://localhost:61616?broker.persistent=false" />
>        </bean>
>
>        <bean id="camelTracer"
> class="org.apache.camel.processor.interceptor.Tracer">
>                <property name="traceExceptions" value="false" />
>                <property name="traceInterceptors" value="true" />
>                <property name="logLevel" value="FATAL" />
>                <property name="logName" value="com.xpectis.tracker" />
>        </bean>
>
>        <bean id="traceFormatter"
> class="org.apache.camel.processor.interceptor.TraceFormatter">
>                <property name="showBody" value="true" />
>                <property name="showHeader" value="true" />
>                <property name="showBodyType" value="false" />
>                <property name="showBreadCrumb" value="false" />
>        </bean>
>
>        <camelContext id="camel" trace="true"
>                xmlns="http://activemq.apache.org/camel/schema/spring">
>                <jmxAgent id="agent" createConnector="true" />
>                <route>
>                        <from uri="file:///d:/temp/quotes/?delete=false" />
>                        <splitter>
>                                <xpath>//price</xpath>
>                                <setHeader headerName="stock">
>                                        <xpath>//price/@stock</xpath>
>                                </setHeader>
>                                <setHeader headerName="queueName">
>                                        <simple>"jms:topic:STOCK.${in.header.stock}
>                                        </simple>
>                                </setHeader>
>                        </splitter>
>                        <recipientList>
>                                <header>queueName</header>
>                        </recipientList>
>                </route>
>        </camelContext>
> </beans>
>
> log :
>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> splitter(//price)         ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{CamelFileLastModified=Mon Oct 20 16:39:16 CEST 2008,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=437,
> CamelFileName=quotes.xml, CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} , BodyType:java.io.File , Body:<?xml
> version="1.0" encoding="ISO-8859-1"?>
> <quotes>
> <price stock="MSFT" bid="2.008" offer="2.012" movement="2"/>
> <price stock="SUNW" bid="1.034" offer="1.035" movement="2"/>
> <price stock="IBMW" bid="2.008" offer="2.012" movement="2"/>
> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
> <price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
> </quotes>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=0, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@489c42,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=0, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=1, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@9b774e,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=1, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=2, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@8210fc,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=2, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=3, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@1292738,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=3, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=4, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@16f2067,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=4, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
> Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> CamelFileName=quotes.xml, CamelFileLength=437,
> CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
> org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> setHeader("jms:topic:STOCK.${in.header.stock}
>                                        ) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
> CamelFileLength=437, CamelFileName=quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
> org.apache.camel.splitCounter=5, org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> recipientList(${in.header.queueName}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
> CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
> queueName="jms:topic:STOCK.BEAS
>                                        , org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
> INFO: ID-dell-charles/1934-1224580718328/2-0 ->
> recipientList(${in.header.queueName}) , Pattern:InOnly ,
> Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
> exclusive valid],
> org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
> Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
> 16:39:16 CEST 2008,
> stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
> CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
> CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
> CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
> org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
> queueName="jms:topic:STOCK.BEAS
>                                        , org.apache.camel.file.name=quotes.xml} ,
> BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
> Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/>
> org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
> "jms:topic:STOCK.BEAS
>                                        , please check your classpath contains the needed camel component jar.
>        at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
>        at
> org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:86)
>        at
> org.apache.camel.processor.RecipientList.resolveEndpoint(RecipientList.java:79)
>        at
> org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:70)
>        at org.apache.camel.processor.RecipientList.process(RecipientList.java:59)
>        at
> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
>        at
> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
>        at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:75)
>        at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
>        at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:90)
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
>        at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
>        at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:50)
>        at
> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
>        at
> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
>        at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
>        at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>        at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
>        at
> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:153)
>        at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:89)
>        at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:99)
>        at org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:65)
>        at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
>        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
>        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown
> Source)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown
> Source)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
> Source)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>        at java.lang.Thread.run(Unknown Source)
> 21-oct.-2008 11:18:53 org.apache.camel.processor.Logger log
>
> KR,
>
> Charles Moulliard
>
>
> janstey wrote:
>>
>> 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 : cmoulliard@xpectis.com
>>> web site :  www.xpectis.com www.xpectis.com
>>> My Blog :  http://cmoulliard.blogspot.com/
>>> http://cmoulliard.blogspot.com/
>>>
>>
>>
>>
>
>
> -----
> Enterprise Architect
>
> Xpectis
> 12, route d'Esch
> L-1470 Luxembourg
>
> Phone +352 25 10 70 470
> Mobile +352 621 45 36 22
>
> e-mail : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/
> --
> View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20086157.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Re: How to define dynamically the jms uri ?

Posted by cmoulliard <cm...@gmail.com>.
Many thanks for your help.

I try to implement what you propose bu I receive on the console the
following error "No endpoint could be found for : "jms:topic:STOCK.BEAS"

Remark : BEAS is a stock name.

Here is my code and the log generated :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans 
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/context 
       http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://activemq.apache.org/camel/schema/spring 
       http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

	<!--  ActiveMQ brokerURL using VM protocol -->
	<bean id="jms"
class="org.apache.activemq.camel.component.ActiveMQComponent">
		<property name="brokerURL"
value="vm://localhost:61616?broker.persistent=false" />
	</bean>

	<bean id="camelTracer"
class="org.apache.camel.processor.interceptor.Tracer">
		<property name="traceExceptions" value="false" />
		<property name="traceInterceptors" value="true" />
		<property name="logLevel" value="FATAL" />
		<property name="logName" value="com.xpectis.tracker" />
	</bean>

	<bean id="traceFormatter"
class="org.apache.camel.processor.interceptor.TraceFormatter">
		<property name="showBody" value="true" />
		<property name="showHeader" value="true" />
		<property name="showBodyType" value="false" />
		<property name="showBreadCrumb" value="false" />
	</bean>

	<camelContext id="camel" trace="true"
		xmlns="http://activemq.apache.org/camel/schema/spring">
		<jmxAgent id="agent" createConnector="true" />
		<route>
			<from uri="file:///d:/temp/quotes/?delete=false" />
			<splitter>
				<xpath>//price</xpath>
				<setHeader headerName="stock">
					<xpath>//price/@stock</xpath>
				</setHeader>
				<setHeader headerName="queueName">
					<simple>"jms:topic:STOCK.${in.header.stock}
					</simple>
				</setHeader>
			</splitter>
			<recipientList>
				<header>queueName</header>
			</recipientList>
		</route>
	</camelContext>
</beans>

log :

21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> splitter(//price)         ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{CamelFileLastModified=Mon Oct 20 16:39:16 CEST 2008,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileLength=437,
CamelFileName=quotes.xml, CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} , BodyType:java.io.File , Body:<?xml
version="1.0" encoding="ISO-8859-1"?>
<quotes>
<price stock="MSFT" bid="2.008" offer="2.012" movement="2"/>
<price stock="SUNW" bid="1.034" offer="1.035" movement="2"/>
<price stock="IBMW" bid="2.008" offer="2.012" movement="2"/>
<price stock="BEAS" bid="1.734" offer="1.035" movement="2"/> 
<price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
<price stock="BEAS" bid="1.734" offer="1.035" movement="2"/>
</quotes> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=0, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@489c42,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=0, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="2.008" movement="2" offer="2.012" stock="MSFT"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=1, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@9b774e,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=1, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.034" movement="2" offer="1.035" stock="SUNW"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=2, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@8210fc,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=2, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="2.008" movement="2" offer="2.012" stock="IBMW"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=3, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@1292738,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=3, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=4, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@16f2067,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=4, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 -> setHeader(/price/@stock)  ,
Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
CamelFileName=quotes.xml, CamelFileLength=437,
CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
setHeader("jms:topic:STOCK.${in.header.stock}
					) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008, CamelFileAbsolutePath=d:\temp\quotes\quotes.xml,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
CamelFileLength=437, CamelFileName=quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
CamelFilePath=d:\temp\quotes\quotes.xml, CamelFileParent=d:\temp\quotes,
org.apache.camel.splitCounter=5, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
recipientList(${in.header.queueName}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
queueName="jms:topic:STOCK.BEAS
					, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger process
INFO: ID-dell-charles/1934-1224580718328/2-0 ->
recipientList(${in.header.queueName}) , Pattern:InOnly ,
Properties:{org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807
exclusive valid],
org.apache.camel.file.lock.name=d:\temp\quotes\quotes.xml.camelLock} ,
Headers:{org.apache.camel.splitSize=6, CamelFileLastModified=Mon Oct 20
16:39:16 CEST 2008,
stock=com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList@148bd9d,
CamelFileAbsolutePath=d:\temp\quotes\quotes.xml, CamelFileName=quotes.xml,
CamelFileLength=437, CamelFilePath=d:\temp\quotes\quotes.xml,
CamelFileCanonicalPath=D:\Temp\quotes\quotes.xml,
org.apache.camel.splitCounter=5, CamelFileParent=d:\temp\quotes,
queueName="jms:topic:STOCK.BEAS
					, org.apache.camel.file.name=quotes.xml} ,
BodyType:com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl ,
Body:<price bid="1.734" movement="2" offer="1.035" stock="BEAS"/> 
org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
"jms:topic:STOCK.BEAS
					, please check your classpath contains the needed camel component jar.
	at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:54)
	at
org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:86)
	at
org.apache.camel.processor.RecipientList.resolveEndpoint(RecipientList.java:79)
	at
org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:70)
	at org.apache.camel.processor.RecipientList.process(RecipientList.java:59)
	at
org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
	at
org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:75)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:106)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:90)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:50)
	at
org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:50)
	at
org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:79)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:84)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
	at
org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:153)
	at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:89)
	at
org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:99)
	at org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:65)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
	at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown
Source)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown
Source)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
21-oct.-2008 11:18:53 org.apache.camel.processor.Logger log

KR,

Charles Moulliard


janstey wrote:
> 
> 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 : cmoulliard@xpectis.com
>> web site :  www.xpectis.com www.xpectis.com 
>> My Blog :  http://cmoulliard.blogspot.com/
>> http://cmoulliard.blogspot.com/  
>>   
> 
> 
> 


-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20086157.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to define dynamically the jms uri ?

Posted by Jonathan Anstey <ja...@gmail.com>.
*** replaces camel dev hat with camel user hat

Yeah, I agree with doing whatever is easier too :)

Claus Ibsen wrote:
> Hi
>
> Ah yeah you can do a lot in DSL but sometimes it just easier to add a plain POJO bean (or processor) that does the trick, then it's plain readable Java code that everyone knows to read ;)
>
>
> Med venlig hilsen
>  
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: Jonathan Anstey [mailto:janstey@gmail.com] 
> Sent: 20. oktober 2008 17:59
> To: camel-user@activemq.apache.org
> Subject: Re: How to define dynamically the jms uri ?
>
> 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 : cmoulliard@xpectis.com
>> web site :  www.xpectis.com www.xpectis.com 
>> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
>>   
>>     
>
>   


RE: How to define dynamically the jms uri ?

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Ah yeah you can do a lot in DSL but sometimes it just easier to add a plain POJO bean (or processor) that does the trick, then it's plain readable Java code that everyone knows to read ;)


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Jonathan Anstey [mailto:janstey@gmail.com] 
Sent: 20. oktober 2008 17:59
To: camel-user@activemq.apache.org
Subject: Re: How to define dynamically the jms uri ?

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 : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
>   


Re: How to define dynamically the jms uri ?

Posted by Jonathan Anstey <ja...@gmail.com>.
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 : cmoulliard@xpectis.com
> web site :  www.xpectis.com www.xpectis.com 
> My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
>   


RE: How to define dynamically the jms uri ?

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

You are looking for the dynamic recipients EIP pattern
http://activemq.apache.org/camel/recipient-list.html

So just add the endpoint URI as a header on the exchange and then refer to this header in the route, example in the link above.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: cmoulliard [mailto:cmoulliard@gmail.com] 
Sent: 20. oktober 2008 15:55
To: camel-user@activemq.apache.org
Subject: How to define dynamically the jms uri ?


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 : cmoulliard@xpectis.com
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: http://www.nabble.com/How-to-define-dynamically-the-jms-uri---tp20067678s22882p20067678.html
Sent from the Camel - Users mailing list archive at Nabble.com.