从Stomp API设置预取限制



amq docs注意,建立连接时可以设置预取限制 - 是否有一种方法可以使用 stomp.py 设置预取限制实例化队列连接时?

我也问自己这个问题,因此,如果有人仍然需要此问题的帮助:

可以将ActiveMQ标头添加为字典。可能的配置的完整列表在这里。

例如
connection = stomp.Connection()
connection.start()
connection.connect('username', 'password', wait=True)
# set callback
connection.set_listener('', self)
connection.subscribe(destination='/queue/test', id=1, ack='auto', headers={'activemq.prefetchSize': 1})

最新更新