我定义了以下JMS使用者代理服务:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="DefiDealerProxy" transports="jms" statistics="enable" trace="enable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true" scope="default" type="STRING" />
</inSequence>
</target>
<parameter name="transport.jms.ConnectionFactory">myTopicConnectionFactory</parameter>
<parameter name="transport.jms.Destination">activemq.topic.sync</parameter>
<parameter name="transport.jms.DestinationType">topic</parameter>
<parameter name="transport.jms.MessageSelector">ACTION = 'Save' AND ENTITY = 'dealer'</parameter>
<parameter name="transport.jms.SubscriptionDurable">true</parameter>
<parameter name="transport.jms.DurableSubscriberName">My Subscriber</parameter>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
</proxy>
这是我的axis2.xml配置:
<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">failover:tcp://localhost:61616</parameter>
<parameter name="transport.jms.UserName">user</parameter>
<parameter name="transport.jms.Password">password</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
<parameter name="transport.jms.DurableSubscriberClientID" locked="false">myHomePC</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">failover:tcp://localhost:61616</parameter>
<parameter name="transport.jms.UserName">user</parameter>
<parameter name="transport.jms.Password">password</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
<parameter name="transport.jms.DurableSubscriberClientID" locked="false">myHomePC</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">failover:tcp://localhost:61616</parameter>
<parameter name="transport.jms.UserName">user</parameter>
<parameter name="transport.jms.Password">password</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
<parameter name="transport.jms.DurableSubscriberClientID" locked="false">myHomePC</parameter>
</parameter>
</transportReceiver>
在源模式下创建代理服务并保存。它成功连接到ActiveMQ代理并按预期接收消息。但是,我无法在设计或源模式下再次编辑代理服务,因为单击“编辑”按钮后UI会完全更改。我在ESB 4.6&amp; 4.7。有人遇到过这个问题吗?任何帮助将不胜感激。
答案 0 :(得分:0)
似乎是<parameter name="transport.jms.MessageSelector">ACTION = 'Save' AND ENTITY = 'dealer'</parameter>
行内的单引号导致问题。
我能够使用以下配置获得可编辑的代理服务。
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="DefiDealerProxy"
transports="jms"
statistics="enable"
trace="enable"
startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
</inSequence>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>application/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.MessageSelector">ACTION=Save AND ENTITY = dealer</parameter>
<parameter name="transport.jms.ConnectionFactory">myTopicConnectionFactory</parameter>
<parameter name="transport.jms.DestinationType">topic</parameter>
<parameter name="transport.jms.Destination">activemq.topic.sync</parameter>
<parameter name="transport.jms.DurableSubscriberName">My Subscriber</parameter>
<description/>
</proxy>