ssl - 如何在服务组合中使用嵌入式 Active MQ Broker 为 Camel Route 设置 SSL?

标签 ssl apache-camel activemq apache-servicemix

我正在尝试使用蓝图 XML 进行设置

我的蓝图 XML 看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<blueprint
    xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route>
        <from uri="file:activemq/input"/>
        <to uri="file:activemq/output"/>

        <setBody>
          <simple>
            FileMovedEvent(file: ${file:name}, timestamp: ${date:now:hh:MM:ss.SSS})
          </simple>
        </setBody>
        <to uri="activemqs:queue:Main.Queue.Vibhav"/> 
      </route>
    </camelContext>

    <bean id="activemqConnectionFactory" class="org.apache.activemq.ActiveMQSslConnectionFactory">
        <property name="brokerURL" value="ssl://localhost:61616" /> 
        <property name="keyStore" value="file:C:/Users/xxx/Desktop/apache-servicemix-4.5.3/etc/myclient.ks"/>
        <property name="keyStorePassword" value="test123"/>
        <property name="trustStore" value = "file:C:/Users/xxx/Desktop/apache-servicemix-4.5.3/etc/myclient.ts"/>
    </bean>

    <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
        <property name="maxConnections" value="8" />
        <property name="connectionFactory" ref="activemqConnectionFactory" />
    </bean>

      <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
        <property name="connectionFactory" ref="pooledConnectionFactory"/>
        <property name="transacted" value="false"/>
        <property name="concurrentConsumers" value="10"/>
      </bean>

      <bean id="activemqs" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="configuration" ref="jmsConfig"/>
      </bean>


</blueprint>

注意:在代理中我已经添加了 ssl 上下文和 ssl 连接器,还有具有 jaas 领域 ssl 证书的插件。

最佳答案

我通过在连接工厂属性中设置信任库密码解决了这个问题。

关于ssl - 如何在服务组合中使用嵌入式 Active MQ Broker 为 Camel Route 设置 SSL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21690452/

相关文章:

java - 向 Camel 路由添加延迟会导致 Atomikos 超时

java - 如何发送文本消息而不是字节消息

java - 我的 Apache Camel 处理器不工作

ssl - TLS(传输层安全)是否支持 HTTPS?

django - 使用 nginx+gunicorn+django 的间歇性 502s

java - 使用 Apache Camel 发送 POST 请求

停止时的 ActiveMQ 异常

java - 从远程机器访问 Grails ActiveMQ

mobile - 如何确保 http 请求不是手工制作的?

node.js - SELF_SIGNED_CERT_IN_CHAIN 和 DEPTH_ZERO_SELF_SIGNED_CERT 有什么区别