简体   繁体   English

wso2 EI 611 ActiveMQ

[英]wso2 EI 611 ActiveMQ

Declared Message store in ESB ESB中已声明的消息存储

<?xml version="1.0" encoding="UTF-8"?>
<messageStore class="org.apache.synapse.message.store.impl.jms.JmsStore" name="MySQLStockAdjustment" xmlns="http://ws.apache.org/ns/synapse">
    <parameter name="store.jms.destination">MySQLStockAdjustment</parameter>
    <parameter name="store.failover.message.store.name">MySQLStockAdjustmentFailover</parameter>
    <parameter name="store.jms.connection.factory">myQueueConnectionFactory</parameter>
    <parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
    <parameter name="store.jms.cache.connection">false</parameter>
    <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.JMSSpecVersion">1.1</parameter>
</messageStore>

and I just want for beginning to store the mesage in it and than use a proxy to read messages form it .. 我只想开始在其中存储消息,而不是使用代理从中读取消息..

proxy is simple 代理很简单

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="stockAdjustment" startOnLoad="true" transports="jms" xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <!--  get all data -->
            <sequence key="AdjustmentContext"/>
            <filter regex="MySQL" source="$ctx:StockSource">
                <then>
                    <iterate expression="//request">
                        <target>
                            <sequence>
                                <property expression="//qty" name="qty" scope="default" type="STRING"/>
                                <property expression="//code" name="code" scope="default" type="STRING"/>
                                <log level="custom">
                                    <property expression="fn:concat('parmams:Code: ' ,$ctx:code, ' ;Qty: ',$ctx:qty)" name="info"/>
                                </log>
                                <call blocking="true">
                                    <endpoint key="StockAdjustmentEp"/>
                                </call>
                            </sequence>
                        </target>
                    </iterate>
                </then>
                <else/>
            </filter>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
        <faultSequence>

        </faultSequence>
    </target>
    <parameter name="transport.jms.Destination">MySQLStockAdjustment</parameter>
    <parameter name="transport.jms.ConnectionFactory">myQueueConnectionFactory</parameter>
</proxy> 

so when I send a data message trough Postman Im getting the following: 因此,当我通过Postman Im发送数据消息时,得到以下信息:

WARN {org.apache.axis2.transport.jms.JMSUtils} - Can't determine size of JMS message; WARN {org.apache.axis2.transport.jms.JMSUtils}-无法确定JMS消息的大小; unsupported message type : org.apache.activemq.command.ActiveMQObjectMessage {org.apache.axis2.transport.jms.JMSUtils} ERROR {org.apache.axis2.transport.base.BaseUtils} - Unsupported JMS message type org.apache.activemq.command.ActiveMQObjectMessage {org.apache.axis2.transport.base.BaseUtils} ERROR {org.apache.axis2.transport.jms.JMSMessageReceiver} - Unknown error processing message {org.apache.axis2.transport.jms.JMSMessageReceiver} 不支持的消息类型:org.apache.activemq.command.ActiveMQObjectMessage {org.apache.axis2.transport.jms.JMSUtils}错误{org.apache.axis2.transport.base.BaseUtils}-不支持的JMS消息类型org.apache.activemq .command.ActiveMQObjectMessage {org.apache.axis2.transport.base.BaseUtils}错误{org.apache.axis2.transport.jms.JMSMessageReceiver}-未知的错误处理消息{org.apache.axis2.transport.jms.JMSMessageReceiver}

message is 消息是

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
    <soapenv:Body>
        <StockAdjRequest>
            <source>MySQL</source>
            <request><qty>2</qty><code>PR2</code></request>
            <request><qty>2</qty><code>PR2</code></request>
            <request><qty>2</qty><code>PR2</code></request>
            </StockAdjRequest>
            </soapenv:Body>
            </soapenv:Envelope>

I see that message ended in queue but I can't read it trough ActiveMQ web console ... 我看到该消息以队列结尾,但是我无法通过ActiveMQ Web控制台读取它。

I documentation I found that maybe a proble that I need to "...If you are using ActiveMQ 5.12.2 and above when working with message stores, you need to set the following system property on server start up for the JMS message store of the ESB Profile to work as expected. 我整理了文档,发现可能存在一个问题,“ ...如果您在使用消息存储时使用ActiveMQ 5.12.2及更高版本,则需要在服务器启动时为JMS消息存储设置以下系统属性ESB配置文件可以正常工作。

-Dorg.apache.activemq.SERIALIZABLE_PACKAGES="*" ...." -Dorg.apache.activemq.SERIALIZABLE_PACKAGES =“ *” ....“

BUt I dont found HOW to do it ... can anyone help me ? 但是我没有找到如何做的...任何人都可以帮助我吗?

When you store a message in a JMS queue defining a messageStore and using store mediator, you don't just store the "textual" payload from the message, but the entire java MessageContext object is serialized and store as a binary message in the queue. 在将消息存储在定义messageStore并使用存储介体的JMS队列中时,您不仅存储了消息中的“文本”有效负载,还对整个java MessageContext对象进行了序列化并将其存储为队列中的二进制消息。

To read such a message, you need to use a message processor, you can't read it with a simple JMS proxy or even jms inbound endpoint. 要读取这样的消息,您需要使用消息处理器,您无法使用简单的JMS代理甚至jms入站端点来读取它。

And you can't read it with ActiveMQ console because it can't deserialize it 而且您无法使用ActiveMQ控制台读取它,因为它无法反序列化它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM