0

我已经完成了消息存储和转发过程所需的所有过程安装了 activeMQ 5.5.1 并在 WSO2eSb 中复制了必要的 Jars 更改了 AXIS2 文件配置也像这样

<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>

        <parameter name="default" locked="false">
            <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
            <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
            <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
            <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
        </parameter>
    </transportReceiver>

INFO - JMSSender JMS Sender 已启动 [2013-07-23 17:02:18,752] INFO - JMSSender JMS Transport Sender 已初始化...之后我创建了 JMS MESSAGE STORE <

messageStore name="faisal" class="org.wso2.carbon.message.store.persistence.jms.JMSMessageStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
   <parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
   <parameter name="store.jms.destination">transport.jms.ConnectionFactoryJNDIName</parameter>
   <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
   <parameter name="store.jms.cache.connection">false</parameter>
</messageStore>

并添加计划的消息转发处理器

<messageProcessor name="process5" class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor" messageStore="faisal" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="max.delivery.attempts">10</parameter>
   <parameter name="message.processor.reply.sequence">Mail_Seq</parameter>
</messageProcessor>

和我这样的代理服务配置

<proxy xmlns="http://ws.apache.org/ns/synapse" name="Message" transports="https,http,jms" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="faisal" value="faisal" scope="default" type="STRING"/>
         <store messageStore="faisal"/>
         <log level="full"/>
      </inSequence>
      <outSequence>
         <log level="full"/>
      </outSequence>
   </target>
   <description></description>
</proxy>

将消息存储在消息存储中但转发是错误的 IF 端点无法正常工作,即使消息正在 WSO2esb 中处理其丢失的消息,它也会给出此消息

[2013-07-23 17:02:18,817]  WARN - ForwardingJob Property target.endpoint not found in the message context , Hence removing the message 
[2013-07-23 17:02:18,869]  WARN - ForwardingJob Property target.endpoint not found in the message context , Hence removing the message 
[2013-07-23 17:08:07,419]  WARN - JMSMessageStore Consumer Receiving time out is not passed in, Setting to default value of 60 secs
4

2 回答 2

0

这是因为您尚未定义目标端点。因此没有地方可以传递消息。因此该消息将被删除。您的突触配置不包含任何端点。

这篇博文可能会对您有所帮助。

http://isharaaruna.blogspot.com/2012/09/jms-transports-in-wso2-esb-with-activemq.html

于 2013-07-24T05:42:43.287 回答
0

使用正确的后端 uri 创建一个地址端点,如下所示。

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="Service1EP">
   <address uri="http://localhost:8080/services/service1"">
      <suspendOnFailure>
         <progressionFactor>1.0</progressionFactor>
      </suspendOnFailure>
      <markForSuspension>
         <retriesBeforeSuspension>0</retriesBeforeSuspension>
         <retryDelay>0</retryDelay>
      </markForSuspension>
   </address>
</endpoint>

然后通过在 inSequence 中添加以下行来在代理服务中引用该端点。

<property name="target.endpoint" value="Service1EP" scope="default" type="STRING"/>
于 2013-07-24T06:35:22.193 回答