我有一个持久订阅ActiveMQ的JMS代理在WSO2 ESB v4.5.1和v4.7中完美运行
我正在尝试在WSO2 ESB v4.8.0(里程碑3或4)中使用它而没有成功
在启动ESB之前,主题未定义到ActiveMQ中,并且没有引用持久订阅者(ActiveMQ控制台中有0个脱机订阅者)
ESB中的JMS代理:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="TestJMSProxy" transports="jms" startOnLoad="true" trace="disable">
<target>
<inSequence>
<log level="full"/>
</inSequence>
<outSequence/>
<faultSequence/>
</target>
<parameter name="transport.jms.ContentType">
<rules>
<jmsProperty>contentType</jmsProperty>
<default>text/xml</default>
</rules>
</parameter>
<parameter name="transport.jms.ConnectionFactory">myTopicConnectionFactory</parameter>
<parameter name="transport.jms.DestinationType">topic</parameter>
<parameter name="transport.jms.SubscriptionDurable">true</parameter>
<parameter name="transport.jms.Destination">MY_TOPIC</parameter>
<parameter name="transport.jms.DurableSubscriberName">TestJMSProxy</parameter>
<parameter name="transport.jms.CacheLevel">consumer</parameter>
<parameter name="transport.jms.DurableSubscriberClientID">1</parameter>
</proxy>
/repository/conf/axis2/axis2.xml中的JMS配置:
<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.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">failover: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">failover:tcp://localhost:61616</parameter>
<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
</parameter>
</transportReceiver>
- &GT;我一直在使用tcp:// localhost:61616和nio:// localhost:61616和相同的effetcs
ESB控制台中出现的错误:
TID: [0] [ESB] [2013-10-25 12:04:00,077] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool}
org.apache.axis2.transport.jms.AxisJMSException: Error acquiring a JMS connection to : TopicConnectionFactory using JNDI properties : {java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory, serviceType=proxy, transport.jms.ConnectionFactoryType=topic, transport.jms.ConnectionFactory=myTopicConnectionFactory, transport.jms.DestinationType=topic, java.naming.provider.url=failover:tcp://localhost:61616}
at org.apache.axis2.transport.jms.ServiceTaskManager.handleException(ServiceTaskManager.java:1000)
at org.apache.axis2.transport.jms.ServiceTaskManager.access$2500(ServiceTaskManager.java:50)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.createConnection(ServiceTaskManager.java:830)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.getConnection(ServiceTaskManager.java:703)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.receiveMessage(ServiceTaskManager.java:493)
at org.apache.axis2.transport.jms.ServiceTaskManager$MessageListenerTask.run(ServiceTaskManager.java:417)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
- &GT; java.lang.OutOfMemoryError之前几次:无法创建新的本机线程
ActiveMQ日志中出现的错误:
2013-10-25 12:03:58,905 | WARN | Failed to add Connection ID:JMROUSSEL7-64437-1382695110115-21:1 | org.apache.activemq.broker.TransportConnection | ActiveMQ Transport: tcp:///127.0.0.1:64803@61616
javax.jms.InvalidClientIDException: Broker: localhost - Client: 1 already connected from tcp://127.0.0.1:64802
at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:243)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:92)
at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:90)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:92)
at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:92)
at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:97)
at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:733)
at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:79)
at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:139)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:149)
at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
at java.lang.Thread.run(Thread.java:662)
- &GT;好几次
我尝试过ActiveMQ 5.7和ActiveMQ 5.9,没有区别
您只需在JMS代理中更改此行,它就可以在WSO2 ESB v4.8中完美运行:<parameter name="transport.jms.SubscriptionDurable">false</parameter>
从队列或消息存储/消息处理器读取的JMS代理在WSO2 ESB 4.8中完美运行
答案 0 :(得分:0)
这是一个错误,我创建了这个jira:https://wso2.org/jira/browse/ESBJAVA-2638 ant它将在ESB的最终4.8.0版本中得到解决