WSO2 ESB v4.5.1 および v4.7 で完全に動作する ActiveMQ への永続的なサブスクリプションを持つ JMS プロキシがあります。
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>
--> tcp://localhost:61616 と nio://localhost:61616 を同じ効果で使用しています
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)
--> 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)
--> 何回か
ActiveMQ 5.7 と ActiveMQ 5.9 を試しましたが、違いはありません
JMS プロキシで次の行を変更するだけで、WSO2 ESB v4.8 で完全に機能します。<parameter name="transport.jms.SubscriptionDurable">false</parameter>
キューまたはメッセージ ストア/メッセージ プロセッサから読み取る JMS プロキシは、WSO2 ESB 4.8 で完全に機能します。