Stomp WebSockets を使用して ActiveMQ サーバーに接続すると、私の extjs5 ブラウザー Web アプリケーションには、パネルを対象とする多数のトピック サブスクリプションがあります。
ヘッダー付きのトピック サブスクリプションの例を次に示します。
var sub = this.mqClient.subscribe('/topic/Status', this.onStatusMsg,
{"ack":"auto","persistent":true,"activemq.retroactive":true,"selector":"TaskId = 1531","activemq.subscriptionName":"status-1531"} );
ユーザーがトピックのサブスクリプションを完了すると、 this.mqClient.unsubscribe( sub ) 呼び出しをトリガーするパネルを閉じます。
そのパネルを再度開くと、同じ activemq.subscriptionName を持つサブスクリプションが作成され、次のエラー応答がトリガーされます。
javax.jms.JMSException: Durable consumer is in use for client: 2015-05-28 15:29:32-0700.0.9276173142716289 and subscriptionName: status-1531
at org.apache.activemq.broker.region.TopicRegion.addConsumer(TopicRegion.java:127)
at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:427)
at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:244)
at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
at org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:104)
at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
at org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:107)
at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:667)
at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:348)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:335)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:189)
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.ws.jetty8.StompSocket.sendToActiveMQ(StompSocket.java:125)
at org.apache.activemq.transport.stomp.ProtocolConverter.sendToActiveMQ(ProtocolConverter.java:199)
at org.apache.activemq.transport.stomp.ProtocolConverter.onStompSubscribe(ProtocolConverter.java:663)
at org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:257)
at org.apache.activemq.transport.ws.jetty8.StompSocket.onMessage(StompSocket.java:82)
at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455$WSFrameHandler.onFrame(WebSocketConnectionRFC6455.java:850)
at org.eclipse.jetty.websocket.WebSocketParserRFC6455.parseNext(WebSocketParserRFC6455.java:349)
at org.eclipse.jetty.websocket.WebSocketConnectionRFC6455.handle(WebSocketConnectionRFC6455.java:225)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)
恒久トピック サブスクリプションを閉じるにはどうすればよいですか?