I have multiple camelContexts created and would like each camelContext to use their own custom threadpool. However, the log shows all my camelContexts are using the same threadpool. What am I missing?
Main Camel Context
<camelContext id="routeLoader_route">
(no threadpool defined)
<route id="RouteCreator" >
<from uri="file://jsonFilePath" />
<bean ref="routeMonitor" method="loadJsontoCreateRoute" />
</route>
(some other routes defined)
</camelContext>
The method "loadJsontoCreateRoute" will read three json files and then create three routes to connect from
endpoint "file://xxx1/out" to endpoint "direct-vm:out.test"
endpoint "file://xxx2/out" to endpoint "direct-vm:out.test"
endpoint "file://xxx3/out" to endpoint "direct-vm:out.test"
Another camel context
<camelContext id="test_out_route">
<threadPoolProfile id="outTestThreadPoolProfile" defaultProfile="true" poolSize="1" maxPoolSize="1" maxQueueSize="1000" rejectedPolicy="CallerRuns"/>
<route id="outboundTestingRouter">
<from uri="direct-vm:out.test"/>
<doTry>
<log message="Outbound Test -- START" loggingLevel="INFO" />
<recipientList>
<method ref="outTestBean" method="dynamicRoute" />
</recipientList>
<doFinally>
<log message="Outbound Test-- END" loggingLevel="INFO" />
<stop/>
</doFinally>
</doTry>
</route>
(Some other routes defined)
</camelContext>
The dynamicRoute method will return a uri for ftp component
Log
20160623 09:48:04.297 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.524 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.526 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.527 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.634 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.636 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.652 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.653 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.749 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.749 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.827 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.827 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.890 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.937 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:04.937 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:04.999 [Camel (routeLoader_route) thread #24 - file://xxx3/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.140 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.358 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.358 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.469 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.471 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.593 [Camel (routeLoader_route) thread #5 - file://xxx1/out] INFO outboundTestingRouter - Outbound Test -- END
20160623 09:48:05.905 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- START
20160623 09:48:05.999 [Camel (routeLoader_route) thread #17 - file://xxx2/out] INFO outboundTestingRouter - Outbound Test -- END
Line 3 to line 10 of the log shows that there is more than 1 outboundTestingRouter route is concurrently running while my threadpool outTestThreadPoolProfile pool size is limit to 1
This indicates that the threadpool outTestThreadPoolProfile is not being used by outboundTestingRouter route
What I do want is to limit the max. number of concurrent usage of route outboundTestingRouter.
Hmm looks like that should work. What about the logging statement says your not using your threadpool?
Things to note:
1) Your route needs to be leveraging a thread pool to make off of the default template.
2) You can always manually assign a threadpool to a component typically with syntax similar to: executorServiceRef="outTestThreadPoolProfile" but make sure you check your component's documentation
3) If your default threadpool profile isn't working you can simply use the standard ThreadPool tag to make an isolated threadpool that can be assigned directly to a component.
Related
I am deploying came jmxAgent in Jboss 6.3.0. Follwing is the code snippet:
<?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:camel="http://camel.apache.org/schema/spring"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd ">
<context:annotation-config />
<!-- start : Files import to camel context-->
<!-- Active MQ message broker -->
<!-- <import resource="classpath:META-INF/spring/message-borker/integration-message-broker.xml" /> -->
<import resource="file:${FIS_HOME}/COMMON/database-context.xml" />
<import resource="file:${FIS_HOME}/CA/job-scheduer-route-context.xml" />
<import resource="file:${FIS_HOME}/CA/jobs-process-route-context.xml" />
<import resource="file:${FIS_HOME}/CA/pci-jobs-process-route-context.xml" />
<import resource="file:${FIS_HOME}/CA/archiving_reports.xml" />
<import resource="file:${FIS_HOME}/COMMON/powercard-sqlFetcher-route-context.xml" />
<import resource="file:${FIS_HOME}/COMMON/rest/rest-context.xml" />
<!-- End : Files import to camel context-->
<camelContext xmlns="http://camel.apache.org/schema/spring" trace="true" streamCache="true"
lazyLoadTypeConverters="true" id="main">
<properties>
<property key="CamelLogEipName" value="com.hp.rcu.rtsp.filemanager.route"/>
</properties>
<propertyPlaceholder id="properties"
location="file:${FIS_HOME}/COMMON/routes.properties"
xmlns="http://camel.apache.org/schema/spring"/>
<jmxAgent id="agent" createConnector="true"/>
</camelContext>
An although the deployment is successful i am able to see the below exception in the logs:
13:50:47,163 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) Exception in thread "Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://205.239.212.91:1099/jmxrmi/camel" java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only
13:50:47,164 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:155)
13:50:47,165 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:63)
13:50:47,165 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:248)
13:50:47,165 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.jboss.as.naming.InitialContext$DefaultInitialContext.bind(InitialContext.java:268)
13:50:47,167 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.jboss.as.naming.NamingContext.bind(NamingContext.java:257)
13:50:47,167 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at javax.naming.InitialContext.bind(InitialContext.java:425)
13:50:47,168 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at javax.naming.InitialContext.bind(InitialContext.java:425)
13:50:47,168 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:644)
13:50:47,168 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:427)
13:50:47,169 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at org.apache.camel.management.DefaultManagementAgent$1.run(DefaultManagementAgent.java:570)
13:50:47,170 ERROR [stderr] (Camel Thread #2 - Camel Thread #1 - JMXConnector: service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel) at java.lang.Thread.run(Thread.java:748)
Also I am not able to connect to the above url from jconsole.
Note: The jboss container is not in my local and in another server. So the JMX url is service:jmx:rmi:///jndi/rmi://uspnsvulx785.elabs.svcs.lxp.com:1099/jmxrmi/camel
Camel version: 2.23.2
You can check this - http://camel.apache.org/camel-jmx.html.
There is a section for JBoss here which will help you configure it.
Ok for now i have a workaround. Rather than implementing jmx connector in Camel, i have used the connector of Jboss itself. You can see all the mbeans of jboss within it. You will find all the mbeans of camel under org.apache.camel.
It will not fix the above exception but you can monitor camel routes and processors.
Also you can remove the jmxAgent line given below from the camel-context.xml if using the jboss connector.
<jmxAgent id="agent" createConnector="true"/>
I have recently moved my routes over to use XA, I am not sure if this is normal behavior or a problem but I am seeing continual reconnecting in the log and the transaction logs are growing when there is no activity as such on the jms queue.
The logs show the following
16:14:19.777 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.datasource.xa.XAResourceTransaction-logInfo - XAResource.start ( 31302E3136322E3230382E3130322E746D30303030323030303032:31302E3136322E3230382E3130322E746D32 , XAResource.TMNOFLAGS ) on resource ConnectionFactoryTESTQM represented by XAResource instance com.ibm.mq.jmqi.JmqiXAResource#27520e8f
16:14:20.806 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsXaSessionProxy-logInfo - atomikos xa session proxy for resource ConnectionFactoryTESTQM: calling getTransacted on JMS driver session...
16:14:20.806 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsMessageConsumerProxy-logInfo - atomikos MessageConsumer proxy for com.ibm.mq.jms.MQQueueReceiver#690215c4: close...
16:14:20.822 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.datasource.xa.XAResourceTransaction-logInfo - XAResource.end ( 31302E3136322E3230382E3130322E746D30303030323030303032:31302E3136322E3230382E3130322E746D32 , XAResource.TMSUCCESS ) on resource ConnectionFactoryTESTQM represented by XAResource instance com.ibm.mq.jmqi.JmqiXAResource#27520e8f
16:14:20.838 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsXaSessionProxy-logInfo - atomikos xa session proxy for resource ConnectionFactoryTESTQM: closing session atomikos xa session proxy for resource ConnectionFactoryTESTQM - is terminated ? false
16:14:20.838 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsConnectionProxy-logInfo - atomikos connection proxy for resource ConnectionFactoryTESTQM: close()...
16:14:20.838 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.icatch.imp.CompositeTransactionImp-logInfo - commit() done (by application) of transaction 10.162.208.102.tm0000200002
16:14:20.978 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.datasource.xa.XAResourceTransaction-logInfo - XAResource.commit ( 31302E3136322E3230382E3130322E746D30303030323030303032:31302E3136322E3230382E3130322E746D32 , true ) on resource ConnectionFactoryTESTQM represented by XAResource instance com.ibm.mq.jmqi.JmqiXAResource#27520e8f
16:14:21.009 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.icatch.imp.BaseTransactionManager-logInfo - createCompositeTransaction ( 300000 ): created new ROOT transaction with id 10.162.208.102.tm0000300002
16:14:21.009 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosConnectionFactoryBean-logInfo - AtomikosConnectionFactoryBean 'ConnectionFactoryTESTQM': createConnection()...
16:14:21.009 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosConnectionFactoryBean-logInfo - AtomikosConnectionFactoryBean 'ConnectionFactoryTESTQM': init...
16:14:21.009 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsConnectionProxy-logInfo - atomikos connection proxy for resource ConnectionFactoryTESTQM: creating XA-capable session...
16:14:21.134 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsConnectionProxy-logInfo - atomikos connection proxy for resource ConnectionFactoryTESTQM: calling hashCode on JMS driver...
16:14:21.134 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsConnectionProxy-logInfo - atomikos connection proxy for resource ConnectionFactoryTESTQM: calling hashCode on JMS driver...
16:14:21.134 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsConnectionProxy-logInfo - atomikos connection proxy for resource ConnectionFactoryTESTQM: calling start on JMS driver...
16:14:21.134 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsXaSessionProxy-logInfo - atomikos xa session proxy for resource ConnectionFactoryTESTQM: calling createQueue on JMS driver session...
16:14:21.134 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsXaSessionProxy-logInfo - atomikos xa session proxy for resource ConnectionFactoryTESTQM: calling createConsumer on JMS driver session com.ibm.mq.jms.MQXASession#41a4d0d0
16:14:21.150 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsMessageConsumerProxy-logInfo - atomikos MessageConsumer proxy for com.ibm.mq.jms.MQQueueReceiver#3cb81a5f: receive ( 1000 )...
16:14:21.150 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.jms.AtomikosJmsMessageConsumerProxy-logInfo - atomikos MessageConsumer proxy for com.ibm.mq.jms.MQQueueReceiver#3cb81a5f: receive ( 1000 , null )...
16:14:21.150 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.icatch.imp.CompositeTransactionImp-logInfo - registerSynchronization ( com.atomikos.jms.ConsumerProducerSupport$JmsRequeueSynchronization#4d70e77 ) for transaction 10.162.208.102.tm0000300002
16:14:21.150 [Camel (camel-1) thread #0 - JmsConsumer[AAA.TESTQ1]] INFO com.atomikos.icatch.imp.CompositeTransactionImp-logInfo - addParticipant ( XAResourceTransaction: 31302E3136322E3230382E3130322E746D30303030333030303032:31302E3136322E3230382E3130322E746D33 ) for transaction 10.162.208.102.tm0000300002
If this is normal then I will just surpress the logging but I figured it worth checking.
thanks
Paul
My camel SFTP consumer connects to server every 10 seconds and during every connect it prints huge log messages as mentioned here.
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex: client:
hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex: client:
none
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex: client:
none
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex: client:
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex: client:
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex:
server->client aes128-ctr hmac-md5 none
02-05-2016 20:48:34,441 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> kex:
client->server aes128-ctr hmac-md5 none
02-05-2016 20:48:34,443 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
SSH_MSG_KEXDH_INIT sent
02-05-2016 20:48:34,444 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> expecting
SSH_MSG_KEXDH_REPLY
02-05-2016 20:48:34,762 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
ssh_rsa_verify: signature true
02-05-2016 20:48:34,762 WARN
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> Permanently
added '11.11.11.11' (RSA) to the list of known hosts.
02-05-2016 20:48:34,763 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
SSH_MSG_NEWKEYS sent
02-05-2016 20:48:34,763 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
SSH_MSG_NEWKEYS received
02-05-2016 20:48:34,763 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
SSH_MSG_SERVICE_REQUEST sent
02-05-2016 20:48:35,079 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
SSH_MSG_SERVICE_ACCEPT received
02-05-2016 20:48:35,391 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
Authentications that can continue:
publickey,keyboard-interactive,password
02-05-2016 20:48:35,391 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> Next
authentication method: publickey
02-05-2016 20:48:35,391 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH ->
Authentications that can continue: password
02-05-2016 20:48:35,391 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> Next
authentication method: password
02-05-2016 20:48:35,707 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> Authentication
succeeded (password).
02-05-2016 20:48:36,662 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] Connected to
sftp://username#11.11.11.11:22
02-05-2016 20:48:36,662 INFO
(org.apache.camel.component.file.remote.SftpConsumer) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] Connected and logged
in to: sftp://username#11.11.11.11:22
02-05-2016 20:48:38,539 INFO
(org.apache.camel.component.file.remote.SftpOperations) [Camel
(camel-99) thread #117 -
sftp://username:******#11.11.11.11:22/download] JSCH -> Disconnecting
from 11.11.11.11 port 22
How can I stop these messages from appearing in the log?
If you are using a logger like log4j, you can simply turn off the JSCH logging with the following line in your logger config:
log4j.logger.org.apache.camel.component.file.remote.SftpOperations = OFF
As an alternative to change the logger config, the current Camel sFTP documentation mentions few options you can set on the endpoint:
jschLoggingLevel
readLockLoggingLevel
runLoggingLevel
For example you can set:
sftp://user#myserver.mydomain.net:9921/path/to/folder?binary=true&jschLoggingLevel=WARN&readLockLoggingLevel=INFO&runLoggingLevel=WARN
You can tweak each category to fit your needs directly in the endpoint without changing the configuration of your logger.
I'm using a quartz trigger quite sporadically to invoke a mybatis select
from( "quartz:'once a minute' )
.pollEnrich( "mybatis://selectItems?statementType=SelectList" )
.process ( ...
the select appears correct and runs in a sql-debugger pad correctly. (currently returns no results because table is empty).
When the quartz trigger invokes it starts the poll-enrich, reports no error but just keeps continually re-running the select on the database.
There seems no end it it, it just keeps polling and polling as fast as it can. It never reaches the process point. I have no idea what could be going wrong with it or a way around this problem. Why it is running the select more than once ... it is as though something fails and it comes tries again, but it doesnt give any error message and normally mybatis is very verbose with errors
I have no idea how to fix this...
Here is a dump of just a small section of the logs
DEBUG 2013-10-30 14:10:28,913 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Openning JDBC Connection
DEBUG 2013-10-30 14:10:28,913 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Resetting autocommit to true on JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:28,913 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Closing JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:29,428 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Openning JDBC Connection
DEBUG 2013-10-30 14:10:29,428 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Resetting autocommit to true on JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:29,428 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Closing JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:29,944 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Openning JDBC Connection
DEBUG 2013-10-30 14:10:29,944 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Resetting autocommit to true on JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:29,944 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Closing JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:30,460 [DBIM] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Openning JDBC Connection
DEBUG 2013-10-30 14:10:30,460 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Resetting autocommit to true on JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
DEBUG 2013-10-30 14:10:30,460 [EXEC] {Camel (camel-1) thread #7 - mybatis://selectItems} JdbcTransaction - Closing JDBC Connection [jdbc:oracle:thin:#X:1234:Y, UserName=A, Oracle JDBC driver]
Use enrich instead of pollEnrich
I upgraded camel from 2.8.0 to 2.10.3 version and my sftp component started failing.
Afaik, sftp component uses stepwise by default and had no trouble to change directories previous to upgrade.
Below is a log entry that I see on camel/jsch
20130113 15:28:54,509 INFO [Camel (camel-1) thread #0 -
file://../test_outbound/] RemoteFileProducer[193]: Connected and
logged in to:
Endpoint[sftp://sftp-user#localhost/incoming?disconnect=true&privateKeyFile=xyz.ppk&privateKeyFilePassphrase=**]
20130113 15:28:54,528 WARN [Camel (camel-1) thread #0 -
file://../test_outbound/] RemoteFileProducer[71]: Writing file failed
with: Cannot change directory to: home 20130113 15:28:54,528 DEBUG
[Camel (camel-1) thread #0 - file://../test_outbound/]
RemoteFileProducer[86]: Disconnecting from:
Endpoint[sftp://sftp-user#localhost/incoming?disconnect=true&privateKeyFile=xyz.ppk&privateKeyFilePassphrase=**]
20130113 15:28:54,529 INFO [Camel (camel-1) thread #0 -
file://../test_outbound/] SftpOperations$JSchLogger[259]: JSCH ->
Disconnecting from localhost port 22 20130113 15:28:54,529 INFO
[Connect thread localhost session] SftpOperations$JSchLogger[259]:
JSCH -> Caught an exception, leaving main loop due to socket closed
Not sure why this is happening? Any ideas appreciated, thanks.
cd works with v2.8.0
20130114 18:42:52,956 INFO [Camel (camel-1) thread #0 -
sftp://user#host/outgoing] RemoteFileConsumer[133]: Connected and
logged in to: sftp://user#host:22 20130114 18:42:52,956 TRACE [Camel
(camel-1) thread #0 - sftp://user#host/outgoing] SftpOperations[339]:
getCurrentDirectory() 20130114 18:42:52,959 TRACE [Camel (camel-1)
thread #0 - sftp://user#host/outgoing] SftpConsumer[68]:
doPollDirectory from absolutePath: outgoing, dirName: null 20130114
18:42:52,959 TRACE [Camel (camel-1) thread #0 -
sftp://user#host/outgoing] SftpOperations[348]:
changeCurrentDirectory(outgoing) 20130114 18:42:52,959 TRACE [Camel
(camel-1) thread #0 - sftp://user#host/outgoing] SftpOperations[389]:
Changing directory: outgoing 20130114 18:42:52,966 TRACE [Camel
(camel-1) thread #0 - sftp://user#host/outgoing] SftpConsumer[81]:
Polling directory: outgoing 20130114 18:42:52,966 TRACE [Camel
(camel-1) thread #0 - sftp://user#host/outgoing] SftpOperations[415]:
listFiles(.) 20130114 18:42:52,982 TRACE [Camel (camel-1) thread #0 -
sftp://user#host/outgoing] SftpConsumer[94]: Found 2 in directory:
outgoing 20130114 18:42:52,982 TRACE [Camel (camel-1) thread #0 -
sftp://user#host/outgoing] SftpOperations[348]:
changeCurrentDirectory(/home/sftp-user) 20130114 18:42:52,982 TRACE
[Camel (camel-1) thread #0 - sftp://user#host/outgoing]
SftpOperations[389]: Changing directory: / 20130114 18:42:52,988 TRACE
[Camel (camel-1) thread #0 - sftp://user#host/outgoing]
SftpOperations[389]: Changing directory: home 20130114 18:42:52,994
TRACE [Camel (camel-1) thread #0 - sftp://user#host/outgoing]
SftpOperations[389]: Changing directory: sftp-user 20130114
18:42:53,000 DEBUG [Camel (camel-1) thread #0 -
sftp://user#host/outgoing] GenericFileConsumer[84]: Took 0.044 seconds
to poll: outgoing
and fails with 2.10.3
20130114 19:15:53,530 INFO [Camel (camel-1) thread #0 -
file://../test_outbound/] RemoteFileProducer[193]: Connected and
logged in to:
Endpoint[sftp://user#host/incoming?disconnect=true&knownHostsFile=known_hosts&privateKeyFile=sftp-user.ppk&privateKeyFilePassphrase=**&separator=Auto]
20130114 19:15:53,530 TRACE [Camel (camel-1) thread #0 -
file://../test_outbound/] SftpOperations[305]:
buildDirectory(incoming,false) 20130114 19:15:53,530 TRACE [Camel
(camel-1) thread #0 - file://../test_outbound/] SftpOperations[372]:
getCurrentDirectory() 20130114 19:15:53,670 TRACE [Camel (camel-1)
thread #0 - file://../test_outbound/] SftpOperations[381]:
changeCurrentDirectory(/home/sftp-user) 20130114 19:15:53,670 TRACE
[Camel (camel-1) thread #0 - file://../test_outbound/]
SftpOperations[372]: getCurrentDirectory() 20130114 19:15:53,670 TRACE
[Camel (camel-1) thread #0 - file://../test_outbound/]
SftpOperations[430]: Changing directory: \ 20130114 19:15:53,749 TRACE
[Camel (camel-1) thread #0 - file://../test_outbound/]
SftpOperations[430]: Changing directory: home 20130114 19:15:53,796
WARN [Camel (camel-1) thread #0 - file://../test_outbound/]
RemoteFileProducer[71]: Writing file failed with: Cannot change
directory to: home
Looks like separator is bad but I tried all 3 options (Windows,Unix,Auto)... none worked.
Accepted as a bug and fixed, see
https://issues.apache.org/jira/browse/CAMEL-5970