Hi
And if you use:
<from uri="jms:topic:SampleT1" id="Camel_JMS_2"/>
<recipientList>
<constant>jms:queue:SampleQ1</constant>
</recipientList>
Just to be sure that the jms queue can be found?
It looks like that the xpath is evaluated to a string "[#text:
jms:queue:SampleQ1]" where it contains the [#text: ] stuff as it shouldn't.
BTW: What version of camel are you using?
About the tokenizer: Maybe the Spring DSL has a missing feature there as well
as you build your expression. And there is no default tonkenize. It's only used
if you add it to your expression. In the sample it's used for a single header
value, such as a String that is split using the tokenizer.
In you case you use a xpath expression that does not need the tokenizer. It
will still create something that can be iterated for the recipenetlist.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Suresh Inavolu [mailto:[EMAIL PROTECTED]
Sent: 2. oktober 2008 17:05
To: [email protected]
Subject: Problem with Dynamic Recipient list and XPath
Hi,
I am working on the dynamic recipient list, and have some problems :-(
with it.
The dynamic recipient list is throwing some exceptions while running -
here are the details
For this pattern (I am using Spring XML configuration instead of Java
DSL):
<route xmlns="http://activemq.apache.org/camel/schema/spring">
<from uri="jms:topic:SampleT1" id="Camel_JMS_2"/>
<recipientList>
<xpath>/root/addr/text()</xpath>
</recipientList>
</route>
It is supposed to send the message to all the recipients listed in the
xpath /root/addr
So if this message is sent to the topic SampleT1,
<root>
<addr>jms:queue:SampleQ1</addr>
<addr>jms:queue:SampleQ2</addr>
<moreDetails>...</moreDetails>
</root>
It should forward the same message to both SampleQ1 and SampleQ2. Is
this right?
But when I run it, it is giving the following exception: Even if I don't
use the text() function (just use the XPath /root/addr) it is giving an
error
org.apache.camel.RuntimeCamelException:
org.apache.camel.NoSuchEndpointException: No endpoint could be found
for: [#text: jms:queue:SampleQ1]
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpoin
tMessageListener.java:71)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvo
keListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invoke
Listener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExec
uteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe
ssageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java
:944)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMe
ssageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.camel.NoSuchEndpointException: No endpoint could
be found for: [#text: jms:queue:SampleQ1]
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelConte
xtHelper.java:54)
at
org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java
:85)
at
org.apache.camel.processor.RecipientList.resolveEndpoint(RecipientList.j
ava:74)
at
org.apache.camel.processor.RecipientList.process(RecipientList.java:65)
at
org.apache.camel.management.InstrumentationProcessor.process(Instrumenta
tionProcessor.java:69)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.j
ava:155)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.j
ava:91)
at
org.apache.camel.management.InstrumentationProcessor.process(Instrumenta
tionProcessor.java:57)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcess
or.java:39)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:41)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:66)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endpoin
tMessageListener.java:68)
... 8 more
Also what is equivalent spring configuration for this DSL:
from("direct:a").recipientList(
header("recipientListHeader").tokenize(","));
I can use a header expression but not the tokenizer,
<route xmlns="http://activemq.apache.org/camel/schema/spring">
<from uri="jms:topic:SampleT1" id="Camel_JMS_2"/>
<recipientList>
<header>$foo</header>
</recipientList>
</route>
So what does the above pattern do? Get the list of all recipient list
from the header - but what is the default tokenize value?
Thanks
Suresh