- Hi, I am using stomp.py module to send and receive messages from
ActiveMQ using python. - While receiving messages listener will read multiple messages within the specified sleep time.
- But I need to read only a single message. It's possible in java. How can I read a single message from ActiveMQ using STOMP?
Here is the listener script which I am testing,
import stomp
import time
class SampleListener(object):
def on_message(self, headers, msg):
print(msg)
conn = stomp.Connection([('localhost',61613)])
conn.set_listener('SampleListener', SampleListener())
conn.start()
conn.connect()
conn.subscribe(destination='queue_name', id=1, ack='auto')
time.sleep(10) # secs
conn.disconnect()