| WARN | Transport Connection to: tcp://ip:port failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too long | org.apache.activemq.broker.TransportConnection.Transport | AmqpInactivityMonitor Async Task: java.util.concurrent.ThreadPoolExecutor$Worker@7e641927[State = -1, empty queue]
我正在尝试从 java[publisher] 向活动 mq 发送消息,该消息正在活动 mq 中排队。订阅者代码是用 python[使用这个库 python-qpid-proton 0.31.0] 编写的。当没有请求发送到活动 mq 时,订阅者保持活动状态。但是,当请求发送到活动 mq 时,“活动持久主题订阅者”中的客户端在处理请求的一段时间后进入“离线持久主题订阅者”。当在 pycharm 中运行相同的代码时可以正常工作,但在 exe 上可以看到这个问题 python 接收器代码如下所示:-
P1 = Receiver(url, subscriptionname)
from proton.reactor import Container
Container(P1).run()
class Receiver(MessagingHandler):
super(Receiver, self).__init__()
def __init__(self, url, subscriptionname):
self.url = Url(url)
self.stopping = False
self.messages_actually_received = 0
self.subscriptionName = subscriptionname
def on_start(self, event):
durable = DurableSubscription()
event.container.container_id = "client"
connection = event.container.connect(self.url)
event.container.create_receiver(connection , self.url.path, name=self.subscriptionName, options=durable)
def on_message(self, event):
if self.stopping:
return
self.messages_actually_received += 1
if event.message.body == 'message':
pass