You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ttom <ta...@nikhef.nl> on 2015/02/27 11:21:06 UTC
STOMP+SSL bridge between two ActiveMQ Brokers using Camel
Hi!
I've been trying to set up a STOMP+SSL bridge between two ActiveMQ brokers
without any luck.
What I want to achieve is the following:
STOMP client --(SEND)--> Broker1 (activemq) --(MAGIC)--> Broker2 (activemq)
--(REC)--> STOMP reciever
These are the only transportConnectors on both brokers:
Broker1: <transportConnector name="stomp+ssl"
uri="stomp+ssl://0.0.0.0:61613/>)
Broker2: <transportConnector name="stomp+ssl"
uri="stomp+ssl://0.0.0.0:61613/>)
The catch is that Broker2 is out of my control domain, so it expects
messages only on the stomp+ssl transportConnector.
I do NOT want to create a network of brokers out of Broker1 and Broker2!
I tried several ways to make the MAGIC happen:
1.) have a networkConnector configured in Broker1 one that forwards messages
to Broker2 as such:
Broker1: <networkConnector uri="static:(stomp+ssl://Broker2:61613)"
staticBridge="true">
This failed with java.lang.IllegalArgumentException: Invalid connect
parameters: {wireFormat.host=Broker2}
If I understand correctly, the networkConnector is used to create a
network of brokers anyway,
which is not really what I want, so I abandoned it.
2.) Use Camel to route messages from Broker1 to Broker2 with the following
config at Broker1:
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
depends-on="Broker1">
<route>
<from uri="broker1-activemq:queue:foo"/>
<to uri="broker2-activemq:queue:foo"/>
</route>
</camelContext>
<bean id="broker1-activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent"
depends-on="Broker1">
<property name="brokerURL"
value="vm://Broker1?create=false&waitForStart=5000"/>
</bean>
<bean id="broker2-activemq"
class="org.apache.camel.component.stomp.StompComponent">
<property name="brokerURL" value="stomp+ssl://Broker2:61613"/>
</bean>
ActiveMQComponent seemed like it cannot do STOMP (
http://mail-archives.apache.org/mod_mbox/activemq-dev/201409.mbox/%3C54063BD6.2050000@gmail.com%3E
)
so I added the camel-stomp and stompjms-client libraries containing
org.apache.camel.component.stomp.StompComponent to activemq/lib/came/.
This setup fails at startup with: Unsupported URI scheme 'stomp+ssl'.
This page (http://camel.apache.org/stomp.html) suggested to change the
'stomp+ssl' to 'tcp' in which case the broker starts up correctly, but the
connection
to Broker2 is refused because it's not using ssl.
Any suggenstions on how to go about this? Isn't there a nice STOMP client
implementation supporting SSL that Camel or ActiveMQ can use natively?
Thanks,
Tom
PS: software versions: apache-activemq-5.11.1 , apache-camel-2.14.1 ,
stompjms-client-1.19
--
View this message in context: http://camel.465427.n5.nabble.com/STOMP-SSL-bridge-between-two-ActiveMQ-Brokers-using-Camel-tp5763254.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: STOMP+SSL bridge between two ActiveMQ Brokers using Camel
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Thanks for raising this. I have logged a ticket to make this easier in
the future
https://issues.apache.org/jira/browse/CAMEL-8413
On Fri, Feb 27, 2015 at 5:41 PM, ttom <ta...@nikhef.nl> wrote:
> Hi,
>
> Ok, so I managed to get down to the bottom of it, and I'll just post this
> for future reference.
>
> I found out that the StompComponent works just fine when there is not
> requirement for SSL. So I went on to see if SSL is supported by it by
> changing the potocol in the url from 'tcp' to 'ssl'. I was happy to see that
> in the logs it actually tries to connect with the SSLEngine but it still
> fails. After a little bit of digging I found out that the StompComponent is
> not passing the SSLContext set in Camel to the stompjms-client, therefore
> the stompjms-client uses the default SSLContext which is not configured with
> the right truststore. I added these two options to the activemq startup
> script, and evrything worked fine afterwards:
>
> -Djavax.net.ssl.trustStore=as-install/domains/domain1/config/cacerts.jks
> -Djavax.net.ssl.trustStorePassword=changeit
>
> Tom
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/STOMP-SSL-bridge-between-two-ActiveMQ-Brokers-using-Camel-tp5763254p5763259.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/
Re: STOMP+SSL bridge between two ActiveMQ Brokers using Camel
Posted by ttom <ta...@nikhef.nl>.
Hi,
Ok, so I managed to get down to the bottom of it, and I'll just post this
for future reference.
I found out that the StompComponent works just fine when there is not
requirement for SSL. So I went on to see if SSL is supported by it by
changing the potocol in the url from 'tcp' to 'ssl'. I was happy to see that
in the logs it actually tries to connect with the SSLEngine but it still
fails. After a little bit of digging I found out that the StompComponent is
not passing the SSLContext set in Camel to the stompjms-client, therefore
the stompjms-client uses the default SSLContext which is not configured with
the right truststore. I added these two options to the activemq startup
script, and evrything worked fine afterwards:
-Djavax.net.ssl.trustStore=as-install/domains/domain1/config/cacerts.jks
-Djavax.net.ssl.trustStorePassword=changeit
Tom
--
View this message in context: http://camel.465427.n5.nabble.com/STOMP-SSL-bridge-between-two-ActiveMQ-Brokers-using-Camel-tp5763254p5763259.html
Sent from the Camel - Users mailing list archive at Nabble.com.