JMS not working with activemq in mule esb - activemq

I am using mulestudio.
I wish to insert the values in jms queue using mule studio .But i have done all required changes but queue is not creating in activemq
I am using activemq-5.8.0 version even i added jar file
my config is
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">
<jms:activemq-connector name="jmsConnector"
brokerURL="tcp://localhost:61616"
maxRedelivery="30"
disableTemporaryReplyToDestinations="true"
acknowledgementMode="CLIENT_ACKNOWLEDGE"
persistentDelivery="true" doc:name="Active MQ" password="admin" username="admin" validateConnections="true">
</jms:activemq-connector> <flow name="Acivemqdemo_flow" doc:name="Acivemqdemo_flow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8087" doc:name="HTTP"/>
<jms:outbound-endpoint queue="queue" connector-ref="jmsConnector" doc:name="JMS">
<jms:transaction action="NONE"/>
</jms:outbound-endpoint>
</flow>
</mule>
i have done as per docs but unable get the expected queue
my error log is
INFO 2014-01-03 16:20:09,890 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting connector: jmsConnector
INFO 2014-01-03 16:20:09,911 [main] org.mule.lifecycle.AbstractLifecycleManager: Starting model: _muleSystemModel
INFO 2014-01-03 16:20:09,912 [main] org.mule.construct.FlowConstructLifecycleManager: Starting flow: Acivemqdemo_flow
INFO 2014-01-03 16:20:09,913 [main] org.mule.processor.SedaStageLifecycleManager: Starting service: Acivemqdemo_flow.stage1
INFO 2014-01-03 16:20:09,919 [main] org.mule.transport.http.HttpConnector: Registering listener: Acivemqdemo_flow on endpointUri: http://localhost:8087
INFO 2014-01-03 16:20:09,924 [main] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse
INFO 2014-01-03 16:20:09,938 [main] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'null'. Object is: HttpMessageReceiver
INFO 2014-01-03 16:20:09,940 [main] org.mule.transport.http.HttpMessageReceiver: Connecting clusterizable message receiver
ERROR 2014-01-03 16:20:09,942 [main] org.mule.exception.DefaultSystemExceptionStrategy:
********************************************************************************
Message : Address already in use (java.net.BindException)
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Address already in use (java.net.BindException)
java.net.PlainSocketImpl:-2 (null)
2. Address already in use (java.net.BindException) (org.mule.transport.ConnectException)
org.mule.transport.http.HttpConnectionManager:73 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.BindException: Address already in use
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:353)
at java.net.ServerSocket.bind(ServerSocket.java:336)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
INFO 2014-01-03 16:20:09,944 [main] org.mule.exception.DefaultSystemExceptionStrategy: Exception caught is a ConnectException, attempting to reconnect...
INFO 2014-01-03 16:20:09,944 [main] org.mule.lifecycle.AbstractLifecycleManager: Stopping connector: connector.http.mule.default
INFO 2014-01-03 16:20:09,945 [main] org.mule.lifecycle.AbstractLifecycleManager: Stopping: 'null'. Object is: HttpMessageReceiver
ERROR 2014-01-03 16:20:09,946 [main] org.mule.transport.http.HttpConnector: null
java.lang.NullPointerException
at org.mule.transport.http.HttpConnector.disconnect(HttpConnector.java:542)
at org.mule.transport.http.HttpMessageReceiver.doDisconnect(HttpMessageReceiver.java:52)
at org.mule.transport.AbstractTransportMessageHandler.disconnect(AbstractTransportMessageHandler.java:251)
at org.mule.transport.AbstractConnector.disconnect(AbstractConnector.java:1656)
at org.mule.exception.AbstractSystemExceptionStrategy.handleReconnection(AbstractSystemExceptionStrategy.java:97)
at org.mule.exception.AbstractSystemExceptionStrategy.handleException(AbstractSystemExceptionStrategy.java:59)
at org.mule.exception.AbstractSystemExceptionStrategy.handleException(AbstractSystemExceptionStrategy.java:77)
at org.mule.lifecycle.AbstractLifecycleManager.invokePhase(AbstractLifecycleManager.java:148)
at org.mule.construct.FlowConstructLifecycleManager.fireStartPhase(FlowConstructLifecycleManager.java:95)
at org.mule.construct.AbstractFlowConstruct.start(AbstractFlowConstruct.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mule.lifecycle.phases.DefaultLifecyclePhase.applyLifecycle(DefaultLifecyclePhase.java:225)
at org.mule.lifecycle.RegistryLifecycleManager$RegistryLifecycleCallback.onTransition(RegistryLifecycleManager.java:276)
at org.mule.lifecycle.RegistryLifecycleManager.invokePhase(RegistryLifecycleManager.java:155)
at org.mule.lifecycle.RegistryLifecycleManager.fireLifecycle(RegistryLifecycleManager.java:126)
at org.mule.registry.AbstractRegistryBroker.fireLifecycle(AbstractRegistryBroker.java:80)
at org.mule.registry.MuleRegistryHelper.fireLifecycle(MuleRegistryHelper.java:120)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:94)
at org.mule.lifecycle.MuleContextLifecycleManager$MuleContextLifecycleCallback.onTransition(MuleContextLifecycleManager.java:90)
at org.mule.lifecycle.MuleContextLifecycleManager.invokePhase(MuleContextLifecycleManager.java:72)
at org.mule.lifecycle.MuleContextLifecycleManager.fireLifecycle(MuleContextLifecycleManager.java:64)
at org.mule.DefaultMuleContext.start(DefaultMuleContext.java:255)
at org.mule.module.launcher.application.DefaultMuleApplication.start(DefaultMuleApplication.java:147)
at org.mule.module.launcher.application.ApplicationWrapper.start(ApplicationWrapper.java:107)
at org.mule.module.launcher.DefaultMuleDeployer.deploy(DefaultMuleDeployer.java:48)
at org.mule.tooling.server.application.ApplicationDeployer.main(ApplicationDeployer.java:127)
INFO 2014-01-03 16:20:09,948 [main] org.mule.transport.http.HttpConnector: Disconnected: HttpConnector
{
name=connector.http.mule.default
lifecycle=stop
this=4f980c26
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[http]
serviceOverrides=<none>
}
INFO 2014-01-03 16:20:09,948 [main] org.mule.transport.http.HttpMessageReceiver: Connecting clusterizable message receiver
ERROR 2014-01-03 16:20:09,948 [main] org.mule.retry.notifiers.ConnectNotifier: Failed to connect/reconnect: HttpConnector
{
name=connector.http.mule.default
lifecycle=stop
this=4f980c26
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=false
supportedProtocols=[http]
serviceOverrides=<none>
}
. Root Exception was: null. Type: class java.lang.NullPointerException
ERROR 2014-01-03 16:20:09,951 [main] org.mule.exception.DefaultSystemExceptionStrategy: null
INFO 2014-01-03 16:20:09,958 [main] org.mule.module.management.agent.WrapperManagerAgent: This JVM hasn't been launched by the wrapper, the agent will not run.
INFO 2014-01-03 16:20:09,969 [main] org.mule.module.management.agent.JmxAgent: Attempting to register service with name: Mule.acivemqjms:type=Endpoint,service="Acivemqdemo_flow",connector=connector.http.mule.default,name="endpoint.http.localhost.8087"
INFO 2014-01-03 16:20:09,969 [main] org.mule.module.management.agent.JmxAgent: Registered Endpoint Service with name: Mule.acivemqjms:type=Endpoint,service="Acivemqdemo_flow",connector=connector.http.mule.default,name="endpoint.http.localhost.8087"
INFO 2014-01-03 16:20:09,970 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.acivemqjms:type=Connector,name="connector.http.mule.default.1"
INFO 2014-01-03 16:20:09,970 [main] org.mule.module.management.agent.JmxAgent: Registered Connector Service with name Mule.acivemqjms:type=Connector,name="jmsConnector.1"
INFO 2014-01-03 16:20:09,972 [main] org.mule.module.launcher.application.DefaultMuleApplication: Reload interval: 3000
INFO 2014-01-03 16:20:09,974 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: acivemqjms *
* OS encoding: UTF-8, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2014-01-03 16:20:09,974 [main] org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'acivemqjms' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
will you help for this and how to consume the message from mule give me any example doc

the mule application cannot start it cannot connect to the http port 8087
it is most likely because you already have an instance running.
Try in order of esculation:
hit the red button in the console window
restart eclipse studio
or if you need to close the eclipse studio, check if you have any java processes running other than activemq
hope that helps.

In Ubuntu use this kill the process and release the port.
fuser -k 80/tcp
replace 80 with port number you need to release.
In Mac, find and kill the PID with netstat.

From your exception java.net.BindException: Address already in use , it seems your inbound address, port is already used by some other endpoint, either by some other Mule endpoint or any other external application.
Solution is, please check once if the port or address is used by other application.
To check, use the command netstat in the following ways to check your port from command prompt :- Command line for looking at specific port

Related

server.HiveServer2: Error starting priviledge synchonizer

Hive version 3.1.2
Hadoop components(hdfs/yarn/historyjob) with kerberos authentication.
hive kerberos config:
hive.server2.authentication=KERBEROS
hive.server2.authentication.kerberos.principal=hiveserver2/_HOST#BDP.COM
hive.server2.authentication.kerberos.keytab=/etc/kerberos/hadoop/hiveserver2.bdp-05.keytab
hive.metastore.sasl.enabled=true
hive.metastore.kerberos.keytab.file=/etc/kerberos/hadoop/metastore.bdp-05.keytab
hive.metastore.kerberos.principal=metastore/_HOST#BDP.COM
First, start the Metastore:
./bin/hive --service metastore > /dev/null &
Nothing unnormal in the log.
Then start hiveserver2 :
./bin/hive --service hiveserver2 > /dev/null &
Here is the start logs :
2020-12-30T11:28:48,746 INFO [main] server.HiveServer2: Starting HiveServer2
2020-12-30T11:28:49,168 INFO [main] security.UserGroupInformation: Login successful for user hiveserver2/bigdata-server-05#BDP.COM using keytab file /etc/kerberos/hadoop/hiveserver2.bdp-05.keytab
2020-12-30T11:28:49,171 INFO [main] cli.CLIService: SPNego httpUGI not created, spNegoPrincipal: , ketabFile:
2020-12-30T11:28:49,187 INFO [main] SessionState: Hive Session ID = 0754b9bc-f2f9-4d4c-ab95-a7359764bc49
2020-12-30T11:28:50,052 INFO [main] session.SessionState: Created HDFS directory: /tmp/hive/hiveserver2/0754b9bc-f2f9-4d4c-ab95-a7359764bc49
2020-12-30T11:28:50,066 INFO [main] session.SessionState: Created local directory: /tmp/hive/0754b9bc-f2f9-4d4c-ab95-a7359764bc49
2020-12-30T11:28:50,069 INFO [main] session.SessionState: Created HDFS directory: /tmp/hive/hiveserver2/0754b9bc-f2f9-4d4c-ab95-a7359764bc49/_tmp_space.db
2020-12-30T11:28:50,600 INFO [main] metastore.HiveMetaStoreClient: Trying to connect to metastore with URI thrift://bigdata-server-05:9083
2020-12-30T11:28:50,605 INFO [main] metastore.HiveMetaStoreClient: HMSC::open(): Could not find delegation token. Creating KERBEROS-based thrift connection.
2020-12-30T11:28:50,653 INFO [main] metastore.HiveMetaStoreClient: Opened a connection to metastore, current connections: 1
2020-12-30T11:28:50,653 INFO [main] metastore.HiveMetaStoreClient: Connected to metastore.
2020-12-30T11:28:50,654 INFO [main] metastore.RetryingMetaStoreClient: RetryingMetaStoreClient proxy=class org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient ugi=hiveserver2/bigdata-server-05#BDP.COM (auth:KERBEROS) retries=1 delay=1 lifetime=0
2020-12-30T11:28:50,781 INFO [main] service.CompositeService: Operation log root directory is created: /tmp/hive/operation_logs
2020-12-30T11:28:50,783 INFO [main] service.CompositeService: HiveServer2: Background operation thread pool size: 100
2020-12-30T11:28:50,783 INFO [main] service.CompositeService: HiveServer2: Background operation thread wait queue size: 100
2020-12-30T11:28:50,783 INFO [main] service.CompositeService: HiveServer2: Background operation thread keepalive time: 10 seconds
2020-12-30T11:28:50,784 INFO [main] service.CompositeService: Connections limit are user: 0 ipaddress: 0 user-ipaddress: 0
2020-12-30T11:28:50,787 INFO [main] service.AbstractService: Service:OperationManager is inited.
2020-12-30T11:28:50,787 INFO [main] service.AbstractService: Service:SessionManager is inited.
2020-12-30T11:28:50,787 INFO [main] service.AbstractService: Service:CLIService is inited.
2020-12-30T11:28:50,787 INFO [main] service.AbstractService: Service:ThriftBinaryCLIService is inited.
2020-12-30T11:28:50,787 INFO [main] service.AbstractService: Service:HiveServer2 is inited.
2020-12-30T11:28:50,835 INFO [pool-7-thread-1] SessionState: Hive Session ID = 693b0399-aabd-42b5-a4b2-a4cebbd325d4
2020-12-30T11:28:50,838 INFO [main] results.QueryResultsCache: Initializing query results cache at /tmp/hive/_resultscache_
2020-12-30T11:28:50,844 INFO [pool-7-thread-1] session.SessionState: Created HDFS directory: /tmp/hive/hiveserver2/693b0399-aabd-42b5-a4b2-a4cebbd325d4
2020-12-30T11:28:50,844 INFO [main] results.QueryResultsCache: Query results cache: cacheDirectory /tmp/hive/_resultscache_/results-23ae949b-6894-4a17-8141-0eacf5fe5a63, maxCacheSize 2147483648, maxEntrySize 10485760, maxEntryLifetime 3600000
2020-12-30T11:28:50,846 INFO [pool-7-thread-1] session.SessionState: Created local directory: /tmp/hive/693b0399-aabd-42b5-a4b2-a4cebbd325d4
2020-12-30T11:28:50,849 INFO [pool-7-thread-1] session.SessionState: Created HDFS directory: /tmp/hive/hiveserver2/693b0399-aabd-42b5-a4b2-a4cebbd325d4/_tmp_space.db
2020-12-30T11:28:50,861 INFO [main] events.NotificationEventPoll: Initializing lastCheckedEventId to 0
2020-12-30T11:28:50,862 INFO [main] server.HiveServer2: Starting Web UI on port 10002
2020-12-30T11:28:50,885 INFO [pool-7-thread-1] metadata.HiveMaterializedViewsRegistry: Materialized views registry has been initialized
2020-12-30T11:28:50,894 INFO [main] util.log: Logging initialized #4380ms
2020-12-30T11:28:51,009 INFO [main] service.AbstractService: Service:OperationManager is started.
2020-12-30T11:28:51,009 INFO [main] service.AbstractService: Service:SessionManager is started.
2020-12-30T11:28:51,010 INFO [main] service.AbstractService: Service:CLIService is started.
2020-12-30T11:28:51,010 INFO [main] service.AbstractService: Service:ThriftBinaryCLIService is started.
2020-12-30T11:28:51,013 WARN [main] security.HadoopThriftAuthBridge: Client-facing principal not set. Using server-side setting: hiveserver2/_HOST#BDP.COM
2020-12-30T11:28:51,013 INFO [main] security.HadoopThriftAuthBridge: Logging in via CLIENT based principal
2020-12-30T11:28:51,019 INFO [main] security.UserGroupInformation: Login successful for user hiveserver2/bigdata-server-05#BDP.COM using keytab file /etc/kerberos/hadoop/hiveserver2.bdp-05.keytab
2020-12-30T11:28:51,019 INFO [main] security.HadoopThriftAuthBridge: Logging in via SERVER based principal
2020-12-30T11:28:51,023 INFO [main] security.UserGroupInformation: Login successful for user hiveserver2/bigdata-server-05#BDP.COM using keytab file /etc/kerberos/hadoop/hiveserver2.bdp-05.keytab
2020-12-30T11:28:51,030 INFO [main] delegation.AbstractDelegationTokenSecretManager: Updating the current master key for generating delegation tokens
2020-12-30T11:28:51,033 INFO [main] security.TokenStoreDelegationTokenSecretManager: New master key with key id=0
2020-12-30T11:28:51,034 INFO [Thread[Thread-8,5,main]] security.TokenStoreDelegationTokenSecretManager: Starting expired delegation token remover thread, tokenRemoverScanInterval=60 min(s)
2020-12-30T11:28:51,035 INFO [Thread[Thread-8,5,main]] delegation.AbstractDelegationTokenSecretManager: Updating the current master key for generating delegation tokens
2020-12-30T11:28:51,035 INFO [Thread[Thread-8,5,main]] security.TokenStoreDelegationTokenSecretManager: New master key with key id=1
2020-12-30T11:28:51,040 INFO [main] thrift.ThriftCLIService: Starting ThriftBinaryCLIService on port 10000 with 5...500 worker threads
2020-12-30T11:28:51,040 INFO [main] service.AbstractService: Service:HiveServer2 is started.
2020-12-30T11:28:51,041 ERROR [main] server.HiveServer2: Error starting priviledge synchonizer:
java.lang.NullPointerException: null
at org.apache.hive.service.server.HiveServer2.startPrivilegeSynchonizer(HiveServer2.java:985) ~[hive-service-3.1.2.jar:3.1.2]
at org.apache.hive.service.server.HiveServer2.start(HiveServer2.java:726) [hive-service-3.1.2.jar:3.1.2]
at org.apache.hive.service.server.HiveServer2.startHiveServer2(HiveServer2.java:1037) [hive-service-3.1.2.jar:3.1.2]
at org.apache.hive.service.server.HiveServer2.access$1600(HiveServer2.java:140) [hive-service-3.1.2.jar:3.1.2]
at org.apache.hive.service.server.HiveServer2$StartOptionExecutor.execute(HiveServer2.java:1305) [hive-service-3.1.2.jar:3.1.2]
at org.apache.hive.service.server.HiveServer2.main(HiveServer2.java:1149) [hive-service-3.1.2.jar:3.1.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_271]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_271]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_271]
at org.apache.hadoop.util.RunJar.run(RunJar.java:318) [hadoop-common-3.1.3.jar:?]
at org.apache.hadoop.util.RunJar.main(RunJar.java:232) [hadoop-common-3.1.3.jar:?]
2020-12-30T11:28:51,044 INFO [main] server.HiveServer2: Shutting down HiveServer2
In my case, the hiveserver2-sit.xml was created by Apache Ranger when turning the ranger-hive-plugin on. Once I disable the ranger-hive-plugin, hiveserver2-sit.xml was edited by Ranger.
Here are the remaining configurations:
<configuration>
<property>
<name>hive.security.authorization.enabled</name>
<value>true</value>
</property>
<property>
<name>hive.security.authorization.manager</name>
<value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider</value>
</property>
<property>
<name>hive.security.authenticator.manager</name>
<value>org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator</value>
</property>
<property>
<name>hive.conf.restricted.list</name>
<value>hive.security.authorization.enabled,hive.security.authorization.manager,hive.security.authenticator.manager</value>
</property>
</configuration>
Start hiveServer2 will encounter the previous exception.
Remove hiveserver2-site.xml will work fine.
I don't know why? Somebody can explain?
is this still actual ? , if yes , check logs . You should see that it tries to connect to zookeeper , if not described it will try to connect to localhost:2181 , so either it must be there or zk quorum servers should be described.

AMQP MissedHeartbeatException

AMQP connector shuts down with MissedHeartbeatException at regular intervals. Below is the connector configuration and exception stack.I am new to AMQP connector any suggestions are appreciated.
I am using amqp transport 3.6.2 and mule server 3.7.2
AMQP Connector Config
<amqp:connector name="AMQP_Connector"
validateConnections="true" host="${amqp.host}"
doc:name="AMQP Connector" virtualHost="${amqp.vhost}"
password="${amqp.password}" port="${amqp.port}"
username="${amqp.user}" numberOfChannels="1">
Exception Details
****************************************************************************
Message : Connection shutdown detected for: AMQP_Connector
Code : MULE_ERROR--2
----------------------------------------------------------------------------
Exception stack is:
1. Heartbeat missing with heartbeat = 580 seconds (com.rabbitmq.client.MissedHeartbeatException)
com.rabbitmq.client.impl.AMQConnection:595 (null)
2. connection error (com.rabbitmq.client.ShutdownSignalException)
com.rabbitmq.client.impl.AMQConnection:715 (null)
3. Connection shutdown detected for: AMQP_Connector (org.mule.transport.ConnectException) org.mule.transport.amqp.internal.connector.AmqpConnector:321 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectException.html)
---------------------------------------------------------------------------
Root Exception stack trace:
com.rabbitmq.client.MissedHeartbeatException: Heartbeat missing with heartbeat = 580 seconds
at com.rabbitmq.client.impl.AMQConnection.handleSocketTimeout(AMQConnection.java:595)
at com.rabbitmq.client.impl.AMQConnection.access$600(AMQConnection.java:65)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:558)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
****************************************************************************
23:44:54.972 03/09/2016 Worker-0 pool-18-thread-1 INFO
Exception caught is a ConnectException, attempting to reconnect...
23:44:54.981 03/09/2016 Worker-0 pool-18-thread-1 INFO
Stopping connector: AMQP_Connector
23:44:54.983 03/09/2016 Worker-0 pool-18-thread-1 INFO
Stopping: 'AMQP_Connector.dispatcher.341143089'. Object is: Dispatcher
23:44:54.984 03/09/2016 Worker-0 pool-18-thread-1 INFO
Disposing: 'AMQP_Connector.dispatcher.341143089'. Object is: Dispatcher
23:44:54.985 03/09/2016 Worker-0 pool-18-thread-1 ERROR
connection is already closed due to connection error; cause: com.rabbitmq.client.MissedHeartbeatException: Heartbeat missing with heartbeat = 580 seconds

Mule AMQP connector fails trying to requeue message

I'm using the AMQP endpoint and have got it working (with one caveat mentioned here [Possible bug with Mule AMQP transport 3.6.2 community) in other places in my Mule application.
I'm trying to build a reliable SMTP queue but having problems.
I made the assumption that if the SMTP connector couldn't perform, it would throw an exception, so by setting message acknowledgement to MANUAL, and catching SMTP exceptions and rejecting (and requeuing) the message in the exception strategy the system should deal with SMTP outages.
My code (slightly simplified) looks like this:
<amqp:connector name="connector.amqp.mule.default" ackMode="MANUAL" doc:name="AMQP Connector" validateConnections="true" host="${amiab-rabbitmq-hostname}" port="${amiab-rabbitmq-portnumber}" password="${amiab-rabbitmq-password}" username="${amiab-rabbitmq-username}"/>
<smtp:connector name="smtpConnector" contentType="text/html" doc:name="SMTPConnector"/>
<flow name="utility-smtpFlow">
<amqp:inbound-endpoint exchangeName="AMQP.DEFAULT.EXCHANGE" queueName="utilitySMTP" exchangeType="direct" responseTimeout="10000" doc:name="AMQP-0-9" queueDurable="true"/>
<logger message="Recevied SMTP Message from Queue" level="INFO" doc:name="Logger"/>
<smtp:outbound-endpoint host="${smtp-hostname}" user="${smtp-username}" password="{smtp-password}" to="#[flowVars.smtpTo]" subject="Testing Message" responseTimeout="10000" doc:name="SMTP"/>
<amqp:acknowledge-message doc:name="AMQP-0-9 Acknowledge Message"/>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<logger message="SMTP Error, Requeuing" level="INFO" doc:name="Logger"/>
<amqp:reject-message requeue="true" doc:name="AMQP-0-9 Reject Message"/>
</catch-exception-strategy>
When my SMTP connector throws an exception, the exception strategy is correctly instigated, but then AMQP throws an error as shown below:
INFO 2015-06-18 16:32:22,383 [HTTP_Listener_AMIAB.worker.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.amqp.internal.transformer.ObjectToAmqpMessage
INFO 2015-06-18 16:32:22,383 [HTTP_Listener_AMIAB.worker.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.amqp.internal.transformer.ObjectToAmqpMessage
INFO 2015-06-18 16:32:22,387 [HTTP_Listener_AMIAB.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.amqp.mule.default.dispatcher.936721322'. Object is: Dispatcher
INFO 2015-06-18 16:32:22,389 [HTTP_Listener_AMIAB.worker.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.amqp.mule.default.dispatcher.936721322'. Object is: Dispatcher
INFO 2015-06-18 16:32:22,446 [[amiab-esb-utility].utility-smtpFlow.stage1.02] org.mule.api.processor.LoggerMessageProcessor: Recevied SMTP Message from Queue
INFO 2015-06-18 16:32:22,457 [[amiab-esb-utility].smtpConnector.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.email.transformers.ObjectToMimeMessage
INFO 2015-06-18 16:32:22,481 [[amiab-esb-utility].smtpConnector.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'smtpConnector.dispatcher.404056326'. Object is: SmtpMessageDispatcher
ERROR 2015-06-18 16:32:22,568 [[amiab-esb-utility].smtpConnector.dispatcher.01] org.mule.exception.CatchMessagingExceptionStrategy:
********************************************************************************
Message : Unable to connect to mail transport.
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. mail.lyrical.co.uk (java.net.UnknownHostException)
java.net.AbstractPlainSocketImpl:178 (null)
2. Unknown SMTP host: mail.lyrical.co.uk (javax.mail.MessagingException)
com.sun.mail.smtp.SMTPTransport:1704 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/mail/MessagingException.html)
3. Unable to connect to mail transport. (org.mule.api.endpoint.EndpointException)
org.mule.transport.email.SmtpMessageDispatcher:67 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/endpoint/EndpointException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.UnknownHostException: mail.lyrical.co.uk
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
INFO 2015-06-17 15:25:47,190 [[amiab-esb-utility].smtpConnector.dispatcher.01] org.mule.api.processor.LoggerMessageProcessor: SMTP Error, Requeuing
WARN 2015-06-17 15:25:47,193 [amqpReceiver.01] org.mule.transport.amqp.internal.endpoint.receiver.MessageReceiverConsumer: Received shutdown signal for consumer tag: amq.ctag-NZ96mnj_oscnpJKAPy16ng, the message receiver will try to restart.
com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 1, class-id=60, method-id=90)
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:478) ~[?:?]
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:315) ~[?:?]
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:144) ~[?:?]
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:91) ~[?:?]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:550) ~[?:?]
at java.lang.Thread.run(Thread.java:745) [?:1.7.0_75]
INFO 2015-06-17 15:25:47,195 [amqpReceiver.01] org.mule.lifecycle.AbstractLifecycleManager: Stopping: 'null'. Object is: MultiChannelMessageSubReceiver
INFO 2015-06-17 15:25:47,195 [amqpReceiver.01] org.mule.transport.amqp.internal.endpoint.receiver.MultiChannelMessageSubReceiver: Connecting clusterizable message receiver
INFO 2015-06-17 15:25:47,195 [amqpReceiver.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'null'. Object is: MultiChannelMessageSubReceiver
INFO 2015-06-17 15:25:47,196 [amqpReceiver.01] org.mule.transport.amqp.internal.endpoint.receiver.MultiChannelMessageSubReceiver: Starting clusterizable message receiver
INFO 2015-06-17 15:25:47,203 [amqpReceiver.01] org.mule.transport.amqp.internal.endpoint.receiver.MultiChannelMessageSubReceiver: Started subscription: amq.ctag-sCCRCnOWKyREyip26pSYDA on channel: AMQChannel(amqp://guest#127.0.0.1:5672/,3)
Have I missed something obvious, or am I misunderstanding how this should be used? Very grateful if anyone can point me in the right direction.
As you have noted in your comment, the smtp:outbound-endpoint being a one-way endpoint, its dispatch operation is performed in another thread, thus it occurs in parallel with the execution of the flow. Therefore, amqp:acknowledge-message gets called anyway, independently of the success or failure of the smtp:outbound-endpoint operation.
You can get around this issue by setting processingStrategy="synchronous" on the flow: this will force all the endpoint interactions to be performed on the inbound thread.
Shameless plug: this is discussed in details in chapter 11.2 of Mule in Action, Second Edition.

Mule ESB: why AMQP is shutting down in-between the flow with error message (Received shutdown signal for consumer tag)

I'm using AMQP connector,and my queues are present in cluster envt. I'm not sure why this message is populated always. But this is not affecting any success running flow. But it is trying to try connections always.
I'm using Amqp transport jar: 3.4.4 ( Even I tried importing with latest jar 3.4.6 jar) same error has happening again.
Amqp client: 3.2.1.
I'm totally confused.
Because I tried the same queues which is not present in cluster it works fine.
Please suggest me where i'm doing wrong.
Using Ack( Manual) changed to 'MULE_AUTO' also. Helpless.
WARN 2015-01-29 14:47:29,639 [amqpReceiver.01] org.mule.transport.amqp.internal.endpoint.receiver.MessageReceiverConsumer: Received shutdown signal for consumer tag: amq.ctag-13inp2uTSjUnIgiNjyFYAA, the message receiver will try to restart.
com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException
at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:715)
at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:705)
atcom.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:564)
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:533)
WARN 2015-01-29 14:47:29,642 [amqpReceiver.03] org.mule.transport.amqp.internal.endpoint.receiver.MessageReceiverConsumer: Received shutdown signal for consumer tag: amq.ctag-G-xCK-Uj-0aF7LcrYIuo3A, the message receiver will try to restart.
com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException
at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:715)
at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:705)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:564)
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:533)
WARN 2015-01-29 14:47:29,642 [amqpReceiver.02] org.mule.transport.amqp.internal.endpoint.receiver.MessageReceiverConsumer: Received shutdown signal for consumer tag: amq.ctag-seeeDsnuB_1sSuo97C8OdQ, the message receiver will try to restart.
com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException
at com.rabbitmq.client.impl.AMQConnection.startShutdown(AMQConnection.java:715)
at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:705)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:564)
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:533)
ERROR 2015-01-29 14:47:29,665 [AMQP Connection] org.mule.exception.DefaultSystemExceptionStrategy:
********************************************************************************
Message : Connection shutdown detected for: AMQP_Connector
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. null (java.io.EOFException)
java.io.DataInputStream:290 (null)
2. connection error; reason: java.io.EOFException (com.rabbitmq.client.ShutdownSignalException)
com.rabbitmq.client.impl.AMQConnection:715 (null)
3. Connection shutdown detected for: AMQP_Connector (org.mule.transport.ConnectException)
org.mule.transport.amqp.internal.connector.AmqpConnector$1:296 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectEx ception.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
INFO 2015-01-29 14:47:29,696 [AMQP Connection ] org.mule.exception.DefaultSystemExceptionStrategy: Exception caught is a ConnectException, attempting to reconnect...
ERROR 2015-01-29 14:47:29,698 [amqpReceiver.03] org.mule.exception.DefaultSystemExceptionStrategy:
********************************************************************************
Message : Impossible to create new channels on connection: amqp://test#11.11.2000.111:1234/
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. clean connection shutdown; reason: Attempt to use closed connection (com.rabbitmq.client.AlreadyClosedException)
com.rabbitmq.client.impl.AMQConnection:168 (null)
2. Impossible to create new channels on connection: amqp://test#11.11.2000.111:1234/ (org.mule.transport.ConnectException)
org.mule.transport.amqp.internal.client.ChannelHandler:204 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectEx ception.html)
ERROR 2015-01-29 15:12:51,604 [amqpReceiver.34] org.mule.transport.amqp.internal.endpoint.receiver.MultiChannelMessageSubReceiver: Failed to restart: MultiChannelMessageSubReceiver(.....)
Edit:
org.mule.api.MessagingException: Failed to ack message w/deliveryTag: 1 on channel: AMQChannel(amqp://ezibuy#10.10.19.159:5672/,1) (org.mule.api.DefaultMuleException). Message payload is of type: String
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:32)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:94)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)
at org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:67)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access$001(InterceptingChainLifecycleWrapper.java:22)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper$1.process(InterceptingChainLifecycleWrapper.java:66)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:58)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)
at org.mule.exception.TemplateMessagingExceptionStrategy.route(TemplateMessagingExceptionStrategy.java:139)
at org.mule.exception.TemplateMessagingExceptionStrategy.handleException(TemplateMessagingExceptionStrategy.java:45)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:37)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:54)
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:109)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:181)
at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:39)
at org.mule.work.WorkerContext.run(WorkerContext.java:286)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.mule.api.DefaultMuleException: Failed to ack message w/deliveryTag: 1 on channel: AMQChannel(amqp://ezibuy#10.10.19.159:5672/,1)
at org.mule.transport.amqp.internal.processor.Acknowledger.ack(Acknowledger.java:63)
at org.mule.transport.amqp.internal.processor.Acknowledger.ack(Acknowledger.java:49)
at org.mule.transport.amqp.internal.processor.Acknowledger.process(Acknowledger.java:38)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
... 32 more
Caused by: com.rabbitmq.client.AlreadyClosedException: channel is already closed due to channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 1, class-id=60, method-id=80)
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:190)
at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:291)
at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:285)
at com.rabbitmq.client.impl.ChannelN.basicAck(ChannelN.java:1012)
at org.mule.transport.amqp.internal.processor.Acknowledger.ack(Acknowledger.java:59)
There should be a delivery-tag flow variable that is used to keep track of the connection. This variable is required to be able to acknowledge the message. I suspect the flow variable is disappearing at some point. This can happen if the ACK is done in a separate thread from the one where the flow starts. The reason is that the delivery-tag variable can't be serialized/deserialized as it is moved to another thread.
Is anything being done asynchronously?
You are probably bitten a bug present when using request-response or request-reply.
Please try to use 3.6 where the bug is fixed.

Mule - Stopping inbound endpoint until outbound endpoint connector is available

I've given my mule config below and I use mule 3.4.0. When my activemq goes down the ftp endpoint reads the inbound files and tries to start the jms connector and I get the follwing error. JMS reconnect doesnt happen until I restart mule. Please help. Thanks
INFO 2013-10-09 13:14:53,925 [ActiveMQ Connection Executor: tcp://localhost/127.0.0.1:61616#43162] org.mule.exception.DefaultSystemExceptionStrategy: Exception caught is a ConnectException, attempting to reconnect...
INFO 2013-10-09 13:14:53,925 [ActiveMQ Connection Executor: tcp://localhost/127.0.0.1:61616#43162] org.mule.lifecycle.AbstractLifecycleManager: Stopping connector: ActiveMQJMSConnector
INFO 2013-10-09 13:14:53,948 [ActiveMQ Connection Executor: tcp://localhost/127.0.0.1:61616#43780] org.mule.exception.DefaultSystemExceptionStrategy: Exception caught is a ConnectException, attempting to reconnect...
ERROR 2013-10-09 13:14:53,949 [ActiveMQ Connection Executor: tcp://localhost/127.0.0.1:61616#43162] org.mule.exception.DefaultSystemExceptionStrategy: Failed to start Jms Connection
ERROR 2013-10-09 13:14:53,949 [ActiveMQ Connection Executor: tcp://localhost/127.0.0.1:61616#43780] org.mule.exception.DefaultSystemExceptionStrategy: Already in lifecycle phase 'stop', cannot fire the same phase twice
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp"
xmlns:file="http://www.mulesoft.org/schema/mule/file"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"
xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/3.4/mule-ftp.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/3.4/mule-file.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.4/mule-jms.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/3.4/mule-xml.xsd">
<mule-xml:namespace-manager includeConfigNamespaces="true"/>
<ftp:endpoint name="FtpEndpointRecv" host="host1" path="/"
port="21" user="aaa" password="aaa"
pollingFrequency="600000" passive="true" >
</ftp:endpoint>
<jms:activemq-connector name="ActiveMQJMSConnector" specification="1.0.2b" brokerURL="tcp://localhost:61616">
<dispatcher-threading-profile maxThreadsActive="10" maxBufferSize="10" maxThreadsIdle="1" threadTTL="600000" poolExhaustedAction="WAIT" threadWaitTimeout="10000"/>
<reconnect-forever frequency="5000"/>
</jms:activemq-connector>
<file:file-to-string-transformer name="FileToStringTransformer"/>
<flow name="ftptojms">
<ftp:inbound-endpoint ref="FtpEndpointRecv" transformer-refs="FileToStringTransformer">
<file:filename-wildcard-filter pattern="*.xml"/>
</ftp:inbound-endpoint>
<all>
<logger level="INFO" message="#['Payload is:'+payload+'\nInbound Headers: '+message.inboundProperties.entrySet()+'\nOutbound Headers: '+message.outboundProperties.entrySet()+'\nExceptions: '+exception]"/>
<file:outbound-endpoint responseTimeout="10000" outputPattern="#[message.inboundProperties.originalFilename]" path="/test/msgcopy/"/>
<processor-chain>
<message-properties-transformer>
<add-message-property key="sourceFile" value="#[message.inboundProperties.originalFilename]"></add-message-property>
<add-message-property key="sourceDir" value="test"></add-message-property>
</message-properties-transformer>
<jms:outbound-endpoint queue="testQ" connector-ref="ActiveMQJMSConnector"></jms:outbound-endpoint>
</processor-chain>
</all>
</flow>
</mule>
Starting/stopping endpoints in case of errors, is not a typical pattern used in Mule.
Instead use a message processor like until-successful to keep retrying the jms:outbound-endpoint interaction until it succeeds.