【问题标题】:How to Setup SSL for Camel Route using the embedded Active MQ Broker in a service mix?如何在服务组合中使用嵌入式 Active MQ 代理为 Camel Route 设置 SSL?
【发布时间】:2018-09-29 06:34:38
【问题描述】:

我正在尝试使用蓝图 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 证书的插件。

【问题讨论】:

  • 您回答了自己的问题吗?这就是它的样子。
  • 每次骆驼尝试连接到 ActiveMQ 时,我们都会收到一个空指针异常。当我跟踪堆栈跟踪时,它看起来没有连接到嵌入式活动 mq 组件。我们在 serviceMix 入门指南中使用带有 ActiveMQ 的示例路由。我们添加了一个使用 ActiveMQSslConnection 的骆驼组件。我也不确定骆驼是如何在没有在 xml 中指定组件的情况下找到“activemq”组件的。
  • 我有很多问题。我将开始一对。嵌入式代理是否在端口 61616 上配置了 SSL 传输?而且,您在哪里看到名为“activemq”的组件?在错误消息中?我看到了“activemqs”组件定义和使用。
  • 粘贴您获得的完整堆栈跟踪也可能会有所帮助。

标签: ssl apache-camel activemq apache-servicemix


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 2013-07-10
    • 1970-01-01
    • 2012-05-13
    • 1970-01-01
    • 1970-01-01
    • 2011-10-25
    相关资源
    最近更新 更多