简体   繁体   English

如何使用 MessageID 从 ActiveMQ 队列访问消息? (Python)

[英]How to access message from ActiveMQ Queue using MessageID? (Python)

I am currently subscribing to Destination Queue via STOMP package in Python, and need to retrieve a message from the response queue based on the input message-ID.我目前正在通过 Python 中的 STOMP package 订阅目标队列,并且需要根据输入消息 ID 从响应队列中检索消息。 I tried using this syntax but it is failing, is there any other alternative?我尝试使用这种语法,但它失败了,还有其他选择吗? Any insight is appreciated!任何见解表示赞赏!

Connection.subscribe(destination = Qname, id = ‘1’,ack=‘client’,conf={‘message-id :MsgID})

For a message which has a property named message-id whose value is, for example, 123 you would use the selector header when subscribing, eg:对于具有名为message-id的属性的消息,例如,其值为123 ,您将在订阅时使用selector header,例如:

Connection.subscribe(destination = Qname, id = '1', ack = 'client', conf = {'selector': 'message-id = 123'})

See the ActiveMQ STOMP documentation for more details.有关更多详细信息,请参阅ActiveMQ STOMP 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM