WSO2 ESB消息处理器:未收到javax.jms.ObjectMessage

时间:2017-07-13 14:34:15

标签: api wso2 wso2esb mq wso2mb

我使用json queue WSO2 Message BrokerAPI WSO2 ESB中插入了一些<?xml version="1.0" encoding="UTF-8"?> <inSequence xmlns="http://ws.apache.org/ns/synapse"> <property name="Accept" scope="transport" type="STRING" value="application/json"/> <call> <endpoint> <http method="GET" uri-template="http://localhost:9769/services/orderApi/orders"/> </endpoint> </call> <iterate continueParent="true" expression="//orders/order"> <target sequence="insertOrdersMQ"/> </iterate> <respond/> </inSequence> 内容:

API

在此json中,我对endpoint的{​​{1}}响应进行了迭代,并使用此Message Broker's queue将订单插入一个sequence

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="insertOrdersMQ" xmlns="http://ws.apache.org/ns/synapse">
    <log level="custom">
        <property name="Log: " value="Inserting order on queue"/>
    </log>
    <property name="OUT_ONLY" value="true"/>
    <property name="FORCE_SC_ACCEPTED" scope="axis2" value="true"/>
    <send>
        <endpoint>
            <address uri="jms:/orders_mb?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=repository/conf/jndi.properties&amp;transport.jms.DestinationType=queue"/>
        </endpoint>
    </send>
</sequence> 

然后,我在Message Processor创建了WSO2 ESB,因为我想在orders_mb queue上使用这些消息,然后在另一个sequence中使用。以下是Message StoreMessage Processor

的代码
<messageStore name="orders_Store" class="org.apache.synapse.message.store.impl.jms.JmsStore" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="java.naming.factory.initial">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
   <parameter name="java.naming.provider.url">repository/conf/jndi.properties</parameter>
   <parameter name="store.jms.destination">orders_mb</parameter>
   <parameter name="store.jms.JMSSpecVersion">1.1</parameter>
   <parameter name="store.producer.guaranteed.delivery.enable">false</parameter>
   <parameter name="store.failover.message.store.name">orders_mb</parameter>
</messageStore>


<messageProcessor name="ordersProcessor" class="org.apache.synapse.message.processor.impl.sampler.SamplingProcessor" messageStore="orders_Store" xmlns="http://ws.apache.org/ns/synapse">
   <parameter name="interval">1000</parameter>
   <parameter name="concurrency">1</parameter>
   <parameter name="sequence">insertOrdersDB</parameter>
   <parameter name="is.active">true</parameter>
</messageProcessor>

最后,sequence Message Processor发送queue的消息<?xml version="1.0" encoding="UTF-8"?> <sequence name="insertOrdersDB" xmlns="http://ws.apache.org/ns/synapse"> <log level="full"> <property name="Log: " value="Removing order from queue"/> </log> </sequence>

API resource

当我致电queue以在Message Processor中插入订单时,它会起作用。但是,当END消耗时,它会注销

  

[2017-07-13 10:06:34,856]警告 - JmsConsumer [orders_mb-C-1]。没有收到javax.jms.ObjectMessage

我不知道出了什么问题,我看到了this问题,询问了同样的问题,但是,我已经插入了强制性的属性,但这里还没有用。

1 个答案:

答案 0 :(得分:0)

尝试在阻止模式下使用呼叫中介。