[mule-user] Dynamic endpoints fail with filtering routers@Mule3

139 views
Skip to first unread message

Nirav Naik

unread,
Oct 13, 2010, 3:01:16 AM10/13/10
to us...@mule.codehaus.org
Hi,

First of all sorry for repeating my query in new thread.

I am facing a problem using filtering routers with dynamic endpoints, My application flow is as follow,

Producer is sending jms message into the queue
Consumer has to identify what is protocol from message property and send that message to outboundurl which is also coming as message property.
After successfull dispatch a custom component has to be executed which will send notification.

More genarilized form...

An External client is posting Text Message through ActiveMQ, each message is having message properties.
Out of all properties there are two properties
"protocol" with possible values "http", "https", "ftp"
and "outboundurl" with any url without scheme e.g. "www.test.com"

In my configuration I have jms:inbound-endpoint which is consuming all messages from queue and sending it to filtering-router, Please see configuration.

Now I think the problem is with arrangement of filtering-routers with dynamic endpoints, Mule works fine for the endpoint configured first in outbound tag, In following configuration ftp works fine because it was mentioned first. But if jms message property is for http then Mule gives error.

It seems Mule is trying to do ftp dispatch only. This problem remains if I use expression-recipient-list-router too.

However configuration works fine if endpoint urls are fixed.

<?xml version="1.0" encoding="UTF-8"?>
<mule ...>

<jms:activemq-connector name="jmsConnector"
specification="1.1" brokerURL="tcp://localhost:61616" />

<http:connector name="HttpConnector" enableCookies="true" keepAlive="true" validateConnections="true">
</http:connector>


<model name="B2BRouting">
<custom-exception-strategy class="ExceptionHandler"></custom-exception-strategy>
<service name="OutboundRouting">
<inbound>
<jms:inbound-endpoint queue="outboundQueue">
</jms:inbound-endpoint>
</inbound>
<outbound>
<filtering-router>
<ftp:outbound-endpoint name="ftpOutbound" address="ftp://admin:admin@#[header:INBOUND:outboundurl]" />
<message-property-filter pattern="protocol=ftp" caseSensitive="false" scope="inbound"/>
</filtering-router>
<filtering-router>
<http:outbound-endpoint name="test" connector-ref="HttpConnector"
address="http://#[header:INBOUND:outboundurl]" method="POST">
</http:outbound-endpoint>
<message-property-filter pattern="protocol=http" caseSensitive="false" scope="inbound"/>
</filtering-router>
</outbound>
</service>
</model>
</mule>

Following are logs generated when I send first message with peoperties "protocol=ftp" and "outboundurl=localhost:21" and second message with peoperties "protocol=http" and "outboundurl=localhost:8080"

Exception:

INFO 2010-10-13 12:15:00,161 [main] org.mule.MuleServer: Mule Server initializing...
INFO 2010-10-13 12:15:00,504 [main] org.mule.config.spring.MuleApplicationContext: Refreshing org.mule.config.spring.MuleApplicationContext@1d04653: startup date [Wed Oct 13 12:15:00 IST 2010]; root of context hierarchy
INFO 2010-10-13 12:15:01,892 [main] org.mule.module.ibeans.config.IBeanHolderConfigurationBuilder: Scanning for annotations using the following paths: {}
INFO 2010-10-13 12:15:02,235 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising model: _muleSystemModel
INFO 2010-10-13 12:15:02,360 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: jmsConnector
INFO 2010-10-13 12:15:02,485 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: HttpConnector
INFO 2010-10-13 12:15:02,516 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising model: B2BRouting
INFO 2010-10-13 12:15:02,610 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: null
INFO 2010-10-13 12:15:02,734 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: null
INFO 2010-10-13 12:15:02,734 [main] org.mule.service.ServiceLifecycleManager: Initialising service: OutboundRouting
INFO 2010-10-13 12:15:02,750 [main] org.mule.component.simple.PassThroughComponent: Initialising: org.mule.component.simple.PassThroughComponent component for: SedaService{OutboundRouting}
INFO 2010-10-13 12:15:02,781 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: connector.VM.0
INFO 2010-10-13 12:15:02,812 [main] org.mule.service.ServiceLifecycleManager: Initialising service: ConfirmRouting
INFO 2010-10-13 12:15:02,812 [main] org.mule.component.DefaultJavaComponent: Initialising: org.mule.component.DefaultJavaComponent component for: SedaService{ConfirmRouting}
INFO 2010-10-13 12:15:02,812 [main] org.mule.config.builders.AutoConfigurationBuilder: Configured Mule using "org.mule.config.spring.SpringXmlConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='/D:/eclipse-jee-galileo-SR2-win32/workspace/Mule300/src/main/app/Xvert-routing-mule-config.xml'}]"
INFO 2010-10-13 12:15:02,812 [main] org.mule.config.builders.AutoConfigurationBuilder: Configured Mule using "org.mule.config.builders.AutoConfigurationBuilder" with configuration resource(s): "[ConfigResource{resourceName='/D:/eclipse-jee-galileo-SR2-win32/workspace/Mule300/src/main/app/Xvert-routing-mule-config.xml'}]"
INFO 2010-10-13 12:15:02,812 [main] org.mule.MuleServer: Mule Server starting...
INFO 2010-10-13 12:15:02,828 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: connector.VM.0
INFO 2010-10-13 12:15:02,828 [main] org.mule.transport.vm.VMConnector: Connected: VMConnector
{
name=connector.VM.0
lifecycle=initialise
this=bd4e3c
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[vm]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:02,828 [main] org.mule.transport.vm.VMConnector: Starting: VMConnector
{
name=connector.VM.0
lifecycle=initialise
this=bd4e3c
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[vm]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:02,844 [main] org.mule.module.management.agent.JmxAgent: Creating and starting JMX agent connector Server
INFO 2010-10-13 12:15:02,844 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: jmsConnector
INFO 2010-10-13 12:15:03,077 [main] org.mule.transport.jms.activemq.ActiveMQJmsConnector: Connected: ActiveMQJmsConnector
{
name=jmsConnector
lifecycle=initialise
this=1555185
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[jms]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:03,077 [main] org.mule.transport.jms.activemq.ActiveMQJmsConnector: Starting: ActiveMQJmsConnector
{
name=jmsConnector
lifecycle=initialise
this=1555185
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[jms]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:03,093 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: HttpConnector
INFO 2010-10-13 12:15:03,093 [main] org.mule.transport.http.HttpConnector: Connected: HttpConnector
{
name=HttpConnector
lifecycle=initialise
this=1861086
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:03,093 [main] org.mule.transport.http.HttpConnector: Starting: HttpConnector
{
name=HttpConnector
lifecycle=initialise
this=1861086
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:03,093 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting model: _muleSystemModel
INFO 2010-10-13 12:15:03,093 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting model: B2BRouting
INFO 2010-10-13 12:15:03,093 [main] org.mule.service.ServiceLifecycleManager: Starting service: OutboundRouting
INFO 2010-10-13 12:15:03,093 [main] org.mule.component.simple.PassThroughComponent: Starting: org.mule.component.simple.PassThroughComponent component for: SedaService{OutboundRouting}
INFO 2010-10-13 12:15:03,093 [main] org.mule.transport.jms.activemq.ActiveMQJmsConnector: Registering listener: OutboundRouting on endpointUri: jms://outboundQueue
INFO 2010-10-13 12:15:03,093 [main] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default inbound transformer: org.mule.transport.jms.transformers.JMSMessageToObject
INFO 2010-10-13 12:15:03,109 [main] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.jms.transformers.ObjectToJMSMessage
INFO 2010-10-13 12:15:03,109 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'null'. Object is: MultiConsumerJmsMessageReceiver
INFO 2010-10-13 12:15:03,155 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'null'. Object is: MultiConsumerJmsMessageReceiver
INFO 2010-10-13 12:15:03,155 [main] org.mule.service.ServiceLifecycleManager: Starting service: ConfirmRouting
INFO 2010-10-13 12:15:03,155 [main] org.mule.component.DefaultJavaComponent: Starting: org.mule.component.DefaultJavaComponent component for: SedaService{ConfirmRouting}
INFO 2010-10-13 12:15:03,155 [main] org.mule.transport.vm.VMConnector: Registering listener: ConfirmRouting on endpointUri: vm://test
INFO 2010-10-13 12:15:03,171 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'null'. Object is: VMMessageReceiver
INFO 2010-10-13 12:15:03,171 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'null'. Object is: VMMessageReceiver
INFO 2010-10-13 12:15:03,171 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: null
INFO 2010-10-13 12:15:03,187 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: null
INFO 2010-10-13 12:15:03,202 [main] org.mule.util.queue.TransactionalQueueManager: Starting ResourceManager
INFO 2010-10-13 12:15:03,202 [main] org.mule.util.queue.TransactionalQueueManager: Started ResourceManager
INFO 2010-10-13 12:15:03,202 [main] org.mule.module.management.agent.WrapperManagerAgent: This JVM hasn't been launched by the wrapper, the agent will not run.
INFO 2010-10-13 12:15:03,233 [main] org.mule.module.management.agent.JmxAgent: Attempting to register service with name: Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Endpoint,service="ConfirmRouting",connector=connector.VM.0,name="endpoint.vm.test"
INFO 2010-10-13 12:15:03,233 [main] org.mule.module.management.agent.JmxAgent: Registered Endpoint Service with name: Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Endpoint,service="ConfirmRouting",connector=connector.VM.0,name="endpoint.vm.test"
INFO 2010-10-13 12:15:03,233 [main] org.mule.module.management.agent.JmxAgent: Attempting to register service with name: Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Endpoint,service="OutboundRouting",connector=jmsConnector,name="endpoint.jms.outboundQueue"
INFO 2010-10-13 12:15:03,233 [main] org.mule.module.management.agent.JmxAgent: Registered Endpoint Service with name: Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Endpoint,service="OutboundRouting",connector=jmsConnector,name="endpoint.jms.outboundQueue"
INFO 2010-10-13 12:15:03,249 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Connector,name="connector.VM.0.1"
INFO 2010-10-13 12:15:03,249 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Connector,name="jmsConnector.1"
INFO 2010-10-13 12:15:03,249 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.781c1a5d-77f9-4de3-8453-a413182db2f2:type=Connector,name="HttpConnector.1"
INFO 2010-10-13 12:15:03,249 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Mule ESB and Integration Platform *
* Version: 3.0.0 Build: Not Set *
* MuleSoft, Inc. *
* For more information go to http://www.mulesoft.org *
* *
* Server started: 10/13/10 12:15 PM *
* Server ID: 781c1a5d-77f9-4de3-8453-a413182db2f2 *
* JDK: 1.6.0_16 (mixed mode, sharing) *
* OS encoding: UTF-8, Mule encoding: UTF-8 *
* OS: Windows XP - Service Pack 3 (5.1, x86) *
* Host: CISCOW42SLPC479 (10.42.100.218) *
* Mode: Development *
* *
* Agents Running: *
* JMX Agent *
**********************************************************************
INFO 2010-10-13 12:15:10,908 [OutboundRouting.2] org.mule.lifecycle.AbstractLifecycleManager: Initialising connector: connector.ftp.0
INFO 2010-10-13 12:15:10,908 [OutboundRouting.2] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: connector.ftp.0
INFO 2010-10-13 12:15:10,908 [OutboundRouting.2] org.mule.transport.ftp.FtpConnector: Connected: FtpConnector
{
name=connector.ftp.0
lifecycle=initialise
this=f1fad1
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[ftp]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:10,908 [OutboundRouting.2] org.mule.transport.ftp.FtpConnector: Starting: FtpConnector
{
name=connector.ftp.0
lifecycle=initialise
this=f1fad1
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[ftp]
serviceOverrides=<none>
}

INFO 2010-10-13 12:15:10,939 [connector.ftp.0.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.ftp.0.dispatcher.15350066'. Object is: FtpMessageDispatcher
INFO 2010-10-13 12:15:10,939 [connector.ftp.0.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.ftp.0.dispatcher.15350066'. Object is: FtpMessageDispatcher
INFO 2010-10-13 12:15:22,731 [connector.ftp.0.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.ftp.0.dispatcher.16555307'. Object is: FtpMessageDispatcher
INFO 2010-10-13 12:15:22,731 [connector.ftp.0.dispatcher.1] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.ftp.0.dispatcher.16555307'. Object is: FtpMessageDispatcher
org.mule.api.transport.DispatchException: Failed to route event via endpoint: org.mule.endpoint.DynamicOutboundEndpoint@0. Message payload is of type: String
at org.mule.transport.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2569)
at org.mule.processor.builder.InterceptingChainMessageProcessorBuilder$InterceptingMessageProcessorAdapter.process(InterceptingChainMessageProcessorBuilder.java:185)
at org.mule.processor.AbstractInterceptingMessageProcessor.processNext(AbstractInterceptingMessageProcessor.java:57)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:177)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:41)
at org.mule.work.WorkerContext.run(WorkerContext.java:309)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Unknown Source)
Caused by: org.mule.transport.ConnectException: Connection reset
at org.mule.transport.ftp.FtpConnector.getOutputStream(FtpConnector.java:556)
at org.mule.transport.ftp.FtpMessageDispatcher.doDispatch(FtpMessageDispatcher.java:46)
at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:88)
at org.mule.transport.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2552)
... 8 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:364)
at org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:540)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:178)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:268)
at org.mule.transport.ftp.FtpConnectionFactory.makeObject(FtpConnectionFactory.java:40)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1148)
at org.mule.transport.ftp.FtpConnector.getFtp(FtpConnector.java:175)
at org.mule.transport.ftp.FtpConnector.createFtpClient(FtpConnector.java:641)
at org.mule.transport.ftp.FtpConnector.getOutputStream(FtpConnector.java:552)
... 11 more

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

http://xircles.codehaus.org/manage_email


hiten p

unread,
Oct 14, 2010, 1:31:58 PM10/14/10
to us...@mule.codehaus.org
Nirav,

Make sure you have the message scoping defined properly and the property you are accessing is available in the specified scope. With Mule3 message properties scoping has become very strict.

Nirav Naik

unread,
Oct 18, 2010, 2:31:37 AM10/18/10
to us...@mule.codehaus.org
Hiten,

Configurations are alright.

The issue has been resolved by using Mule 3.1 build.

I have replaced mule-core-3.0.jar with mule-core-3.1.jar

Everything seems working as of now.

In future I may use Mule 3.1 as a base.

Regards,
Nirav

Nirav Naik

unread,
Oct 18, 2010, 2:32:26 AM10/18/10
to us...@mule.codehaus.org
By using mule-core-3.1.jar
Reply all
Reply to author
Forward
0 new messages