[mule-user] how to set the header value to expression-recipient-list-router.

2 views
Skip to first unread message

kidong

unread,
Jan 8, 2009, 2:55:01 AM1/8/09
to us...@mule.codehaus.org

Hi,

I got a problem with using expression-recipient-list-router.
I want to set the jms queue address from mule message header to the
expression of expression-recipient-list-router like this:
...
<expression-recipient-list-router expression="ADDRESS_TO"
evaluator="header">
<transformer
ref="kicMessageIopTextLineToStringTransformer"/>
<transformer ref="objectToJMSMessageTransformer" />
</expression-recipient-list-router>
...


The header value of 'ADDRESS_TO' is, for insance 'jms://myQueue'.

With this scenario, the message should be sent to the queue 'myQueue' via
jms.

But this approach failed with errors.

Anyone has an idea how to solve this problem?

Thanks in advance.

- Kidong Lee.
--
View this message in context: http://www.nabble.com/how-to-set-the-header-value-to-expression-recipient-list-router.-tp21347240p21347240.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Antoine Borg

unread,
Jan 9, 2009, 3:52:42 AM1/9/09
to us...@mule.codehaus.org
Hi,

It would be helpful if you could post the errors that you received

HTH


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoin...@ricston.com | blog: blog.ricston.com | web: ricston.com

kidong

unread,
Jan 9, 2009, 9:53:59 PM1/9/09
to us...@mule.codehaus.org

Thank you for your interest,

The errors look like this:

2009-01-10 11:45:02,203 ERROR [serviceIopSender.2]
mule.AbstractExceptionListene
r (AbstractExceptionListener.java:391) -
********************************************************************************

Message : The endpoint "jms" is malformed and cannot be
parsed. I
f this is the name of a global endpoint, check the name is correct, that the
end
point exists, and that you are using the correct configuration (eg the "ref"
att
ribute). Note that names on inbound and outbound endpoints cannot be used
to se
nd or receive messages; use a named global endpoint instead.
Type : org.mule.api.endpoint.MalformedEndpointException
Code : MULE_ERROR-64051
JavaDoc :
http://www.mulesource.org/docs/site/current2/apidocs/org
/mule/api/endpoint/MalformedEndpointException.html
********************************************************************************

Exception stack is:
1. The endpoint "jms" is malformed and cannot be parsed. If this is the
name of
a global endpoint, check the name is correct, that the endpoint exists, and
tha
t you are using the correct configuration (eg the "ref" attribute). Note
that n
ames on inbound and outbound endpoints cannot be used to send or receive
message
s; use a named global endpoint instead.
(org.mule.api.endpoint.MalformedEndpoint
Exception)
org.mule.endpoint.MuleEndpointURI:137
(http://www.mulesource.org/docs/site/cur
rent2/apidocs/org/mule/api/endpoint/MalformedEndpointException.html)
********************************************************************************

Root Exception stack trace:
org.mule.api.endpoint.MalformedEndpointException: The endpoint "jms" is
malforme
d and cannot be parsed. If this is the name of a global endpoint, check the
nam
e is correct, that the endpoint exists, and that you are using the correct
confi
guration (eg the "ref" attribute). Note that names on inbound and outbound
endp
oints cannot be used to send or receive messages; use a named global
endpoint in
stead.
at
org.mule.endpoint.MuleEndpointURI.<init>(MuleEndpointURI.java:137)
at org.mule.endpoint.URIBuilder.getEndpoint(URIBuilder.java:173)
at
org.mule.endpoint.AbstractEndpointBuilder.getProperties(AbstractEndpo
intBuilder.java:286)
at
org.mule.endpoint.AbstractEndpointBuilder.doBuildOutboundEndpoint(Abs
tractEndpointBuilder.java:176)
at
org.mule.endpoint.AbstractEndpointBuilder.buildOutboundEndpoint(Abstr
actEndpointBuilder.java:95)
at
org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultE
ndpointFactory.java:86)
at
org.mule.endpoint.DefaultEndpointFactory.getOutboundEndpoint(DefaultE
ndpointFactory.java:62)
at
org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpointF
romString(AbstractRecipientList.java:157)
at
org.mule.routing.outbound.AbstractRecipientList.getRecipientEndpoint(
AbstractRecipientList.java:116)
at
org.mule.routing.outbound.AbstractRecipientList.route(AbstractRecipie
ntList.java:82)
at
org.mule.routing.outbound.DefaultOutboundRouterCollection$1.doInTrans
action(DefaultOutboundRouterCollection.java:64)
at
org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.
java:45)
at
org.mule.routing.outbound.DefaultOutboundRouterCollection.route(Defau
ltOutboundRouterCollection.java:69)
at
org.mule.service.AbstractService.dispatchToOutboundRouter(AbstractSer
vice.java:878)
at
org.mule.model.seda.SedaService.dispatchToOutboundRouter(SedaService.
java:513)
at
org.mule.model.seda.SedaService$ComponentStageWorker.run(SedaService.
java:536)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.run
Worker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:595)

********************************************************************************


- Kidong.

--
View this message in context: http://www.nabble.com/how-to-set-the-header-value-to-expression-recipient-list-router.-tp21347240p21384272.html

Andrew Perepelytsya

unread,
Jan 10, 2009, 11:15:35 AM1/10/09
to us...@mule.codehaus.org
Are you sure this is the right analysis? You haven't specified your Mule version, but according to the latest sources it fails on this validation: url.indexOf(":/") > 0 . That, however, means that the header value is _not_ jms://whatever. Can you debug or trace through the logs to see what is really going on?

HTH,
Andrew

kidong

unread,
Jan 10, 2009, 10:57:37 PM1/10/09
to us...@mule.codehaus.org

Hi Andrew,

I got a success.
I have set List instead of String to mule header 'ADDRESS_TO' in my Service
Component like this:

...
List<String> addressToList = new ArrayList<String>();
addressToList.add("jms://myQueue");

MuleEventContext context = RequestContext.getEventContext();
MuleMessage message = context.getMessage();
message.setProperty("ADDRESS_TO", addressToList);
...

My message payload is just type of String, in config xml, it looks like
this:
...
<outbound>
<expression-recipient-list-router
expression="ADDRESS_TO"
evaluator="header" />
</outbound>
...

With this, my text message could be sent to the queue 'myQueue' via JMS.

- Kidong.

--
View this message in context: http://www.nabble.com/how-to-set-the-header-value-to-expression-recipient-list-router.-tp21347240p21395872.html

benjamine

unread,
May 12, 2009, 4:00:08 PM5/12/09
to us...@mule.codehaus.org
Reply all
Reply to author
Forward
0 new messages