You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sreekumara <sr...@gmail.com> on 2015/07/29 18:20:46 UTC
ActiveMQ Bridge using MQTT and STOMP over SSL- Error
I am trying to make a bridge between Active MQ to Rabbit MQ through activemq
embedded camel configurations using MQTT over SSL and STOMP over SSL
protocols.
Active MQ version details--- apache-activemq-5.10.0
Camel version details ------ Apache Camel 2.15.2
Rabbit MQ version details ---- RabbitMQ.3.5.0
Camel Jars versions used are as given below:
activemq-camel-5.10.0.jar
camel-core-2.15.2.jar
camel-jms-2.15.2.jar
camel-mqtt-2.15.2.jar
camel-rabbitmq-2.15.2.jar
camel-spring-2.15.2.jar
camel-stomp-2.15.2.jar
rabbitmq-client.jar
stompjms-client-1.19.jar
As per camel documentation in the link (http://camel.apache.org/mqtt.html).
I have configured the camel Route for MQTT as below
<route>
<from uri="activemq:topic://testTopic"/>
<to
uri="mqtt:test?host=ssl://<<hostname>>:1884&qualityOfService=AtLeastOnce&publishTopicName=logs&userName=rmqtest:test&password=test"/>
</route>
I am getting below errors in the Active MQ log and Rabbit MQ logs
Active MQ log:
[WARN] 2015-07-29 11:11:16,110 org.apache.camel.component.mqtt.MQTTEndpoint
onFailure - Failed to connect to ssl://<<Host Name>>:1884 due Disconnected
[WARN] 2015-07-29 11:11:17,054 org.apache.camel.spring.SpringCamelContext
shutdownServices - Error occurred while shutting down service:
Endpoint[mqtt:test?host=ssl://<<hostname>>:1884&qualityOfService=AtLeastOnce&publishTopicName=logs&userName=rmqtest:test&password=xxxxxx].
This exception will be ignored.
java.util.concurrent.TimeoutException
at org.fusesource.mqtt.client.Promise.await(Promise.java:83)
at
org.apache.camel.component.mqtt.MQTTEndpoint.doStop(MQTTEndpoint.java:161)
at
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
at
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:141)
at
org.apache.camel.util.ServiceHelper.stopAndShutdownService(ServiceHelper.java:204)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2827)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2852)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2840)
at
org.apache.camel.impl.DefaultCamelContext.doStop(DefaultCamelContext.java:2701)
at
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
at
org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
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:606)
at
org.apache.activemq.console.Main.runTaskClass(Main.java:262)
at org.apache.activemq.console.Main.main(Main.java:115)
Rabbit MQ log:
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started TCP Listener on [::]:5671
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started SSL Listener on [::]:5673
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
rabbit_stomp: default user 'guest' enabled
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
rabbit_stomp: ssl_cert_login enabled
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started STOMP TCP Listener on [::]:6162
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started STOMP SSL Listener on [::]:6164
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started MQTT TCP Listener on [::]:1882
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started MQTT SSL Listener on [::]:1884
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
Server startup complete; 5 plugins started.
* rabbitmq_shovel
* rabbitmq_mqtt
* rabbitmq_stomp
* rabbitmq_amqp1_0
* amqp_client
=ERROR REPORT==== 29-Jul-2015::11:11:07 ===
MQTT detected TLS upgrade error on <<hostname>>:44143 -> <<>hostname>:1884:
connection closed
=ERROR REPORT==== 29-Jul-2015::11:11:07 ===
** Generic server <0.384.0> terminating
** Last message in was {'$gen_cast',
{go,#Port<0.4119>,
#Fun<rabbit_networking.3.120554880>,<0.385.0>}}
** When Server state == undefined
** Reason for termination ==
** {network_error,{ssl_upgrade_error,closed},
"<<hostname>>:44143 -> <<hostname>>:1884"}
Also I have tried adding SSL Context configuration to set trust store like
below.
<camel:sslContextParameters id="sslContextParameters">
<camel:keyManagers keyPassword="<<password>>">
<camel:keyStore password="<<password>>"
resource="/data01/Datapush/client/keycert.p12"/></camel:keyManagers>
<camel:trustManagers>
<camel:keyStore password="<<password>>"
resource="/data01/Datapush/server/trustStore"/></camel:trustManagers>
</camel:sslContextParameters>
I got the same errors like above.
I have configured the camel Route for STOMP as below.
As per camel documentation in the link
((http://camel.apache.org/stomp.html). There is no option for Stomp with SSL
and still I tried the below route configuration in camel.
<route>
<from uri="activemq:topic://testTopic"/>
<to uri="stomp:queue:logs?brokerURL=ssl://<<host name>>:6164&
login=test&passcode=test"/>
</route>
In the Active MQ log there is no error but it is not started and Rabbit MQ
log getting below error.
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started TCP Listener on [::]:5671
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started SSL Listener on [::]:5673
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
rabbit_stomp: default user 'guest' enabled
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
rabbit_stomp: ssl_cert_login enabled
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started STOMP TCP Listener on [::]:6162
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started STOMP SSL Listener on [::]:6164
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started MQTT TCP Listener on [::]:1882
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
started MQTT SSL Listener on [::]:1884
=INFO REPORT==== 29-Jul-2015::11:44:18 ===
Server startup complete; 5 plugins started.
* rabbitmq_shovel
* rabbitmq_mqtt
* rabbitmq_stomp
* rabbitmq_amqp1_0
* amqp_client
=ERROR REPORT==== 29-Jul-2015::11:45:07 ===
STOMP detected TLS upgrade error on <0.375.0> (<<Host Name>>:55176 -> <<Host
Name>>:6164): connection closed
I also tried to connect from ActiveMQ1 to ActiveMQ2 through camel bridge by
using MQTT protocol. But I am not able to connect and getting errors.
ActiveMQ1 route is as below
<route>
<from uri="activemq:topic://testTopic"/>
<to uri="mqtt:testuser?host=ssl://<<host
Name>>:1883&qualityOfService=AtLeastOnce&publishTopicName=testTopic&userName=
testuesr&password=xxxxxx"/>
</route>
In the Active MQ1 log and Active MQ2 log getting the below errors
Active MQ1 log:
[WARN] 2015-07-29 13:51:23,827 org.apache.camel.component.mqtt.MQTTEndpoint
onFailure - Failed to connect to ssl://<<Host Name>>:1883 due Disconnected
[WARN] 2015-07-29 13:51:24,560 org.apache.camel.spring.SpringCamelContext
shutdownServices - Error occurred while shutting down service:
Endpoint[mqtt:bmrsdatapushpublisher?host=ssl://<<Host
Name>>:1883&qualityOfService=AtLeastOnce&publishTopicName=testTopic&userName=testuesr&password=xxxxxx].
This exception will be ignored.
java.util.concurrent.TimeoutException
at org.fusesource.mqtt.client.Promise.await(Promise.java:83)
at
org.apache.camel.component.mqtt.MQTTEndpoint.doStop(MQTTEndpoint.java:161)
at
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
at
org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:141)
at
org.apache.camel.util.ServiceHelper.stopAndShutdownService(ServiceHelper.java:204)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2827)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2852)
at
org.apache.camel.impl.DefaultCamelContext.shutdownServices(DefaultCamelContext.java:2840)
at
org.apache.camel.impl.DefaultCamelContext.doStop(DefaultCamelContext.java:2701)
at
org.apache.camel.support.ServiceSupport.stop(ServiceSupport.java:102)
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:255)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:121)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:332)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
at
org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)
at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)
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:606)
at
org.apache.activemq.console.Main.runTaskClass(Main.java:262)
at
org.apache.activemq.console.Main.main(Main.java:115)
Active MQ2 log:
[ERROR] 2015-07-29 14:35:52,110
org.apache.activemq.broker.TransportConnector onAcceptError - Could not
accept connection from null: java.io.IOException: java.io.IOException:
Connection reset by peer
I am able to connect over SSL successfully from a stand alone java program.
What is wrong in the configurations , does ActiveMQ support MQTT and Stomp
bridges over SSL?
Please help me to setup these bridge connections . Thanks in advance.
Sreekumar
--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-Bridge-using-MQTT-and-STOMP-over-SSL-Error-tp4700054.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.