Camel ActiveMQ JMS Calls using SSL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel ActiveMQ JMS Calls using SSL

mtod09
I'm trying to setup a Camel route to a Secured ActiveMQ server over SSL + JMS.

I have setup connections using other technologies can this be done with Camel?

If so is there an example available?

Thanks

Mike
Reply | Threaded
Open this post in threaded view
|

AW: Camel ActiveMQ JMS Calls using SSL

Burkard Stephan
Hi

This is actually not a Camel thing, but a configuration issue of your AMQ connection. You have to configure an ActiveMQSslConnectionFactory (see below) and change the Broker-URL to ssl://broker:port instead of tcp://broker:port.

If you do 2-Way-SSL you need to provide Keystore-Properties, if it is 1-Way-SSL the trust-store should be enough.

    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQSslConnectionFactory">
        <property name="keyStore" value="yourKeystoreLocation"/>
        <property name="keyStorePassword" value="yourKeystorePassword"/>
        <property name="keyStoreKeyPassword" value="yourKeyPassword"/>
        <property name="trustStore" value="yourTruststoreLocation"/>
        <property name="trustStorePassword" value="yourTruststorePassword"/>
        <property name="brokerURL" value="ssl://broker-host:port"/>
... other properties
    </bean>

The Camel-Endpoint is (no matter if SSL or not) "activemq:queue:yourQueueName"

Regards
Stephan


-----Urspr√ľngliche Nachricht-----
Von: mtod09 [mailto:[hidden email]]
Gesendet: Donnerstag, 18. Mai 2017 15:51
An: [hidden email]
Betreff: Camel ActiveMQ JMS Calls using SSL

I'm trying to setup a Camel route to a Secured ActiveMQ server over SSL + JMS.

I have setup connections using other technologies can this be done with Camel?

If so is there an example available?

Thanks

Mike



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-ActiveMQ-JMS-Calls-using-SSL-tp5799791.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: AW: Camel ActiveMQ JMS Calls using SSL

mtod09
Thanks this helps.

What I'm looking for is a Java Camel Client example using JMS SSL ie ssl://broker:61617
Note: I'm using SpringBoot for creating a Camel Microservice for AWS I'll need to have all the connections run over SSL.

Example:

@Component
public class ESBRoute1 extends RouteBuilder {

    private String validatorStr = "validator:http://xxxxx-dev.xxxxxx.com/messaging/esb/ESBMessageV3.xsd";
    private String namespaceStr = "http://xxxxx.xxxxx.com/messaging/esb";

 @Override
    public void configure() throws Exception {

        from("activemq:queue:esb.*")
                .doTry()
                .to(validatorStr)
                .setHeader("Route1", xpath("/km:FMIMessage/km:Header/km:Route/text()",String.class).namespace("km",namespaceStr))
                .setHeader("FMIHeader", xpath("/km:FMIMessage/km:Header").namespace("km",namespaceStr))
                .recipientList().header("Route1").delimiter(",").convertBodyTo(String.class)
                .log(LoggingLevel.DEBUG,simple("Full Message Sent:\r\n ${body}").toString())
                .log(LoggingLevel.INFO,simple("Header Message:\r\n ${header.FMIHeader}").toString())
            .end();
    }
}