I have a JMS client that is written in Python using Stomp. I'm running Apache activemq 5.10.0
I have a line called Test, and I print the customer log message, which is saying that it is reading the message from the queue, but do not reduce the print statement in my on message method. ActiveMQ shows that the client has read the message, and in Stomp lib a logger prints a message, but the onMessage () does not appear on the print statement.
Any suggestions?
Here is the code:
import time import system import logging import stomp import stomp connection listener queuename = sys.argv [1] logging.basicConfig (level = logging) .DEBUG) Class MyListener (ConnectionListener): Message_count = 0 def on_error (auto, header, message): The print 'An error% s'% Message message is received incorrectly - but _ message # error message (auto, header, Message): DF On_message (Self, Header, Message): Print Header Print Straw (Message) Print Type (Message) Print "Message% D "% (message_count) message_count = message_count + 1 print 'received a message ...% s ...'% message conn = stomp connection () conn.set_listener (', MyListener ()) conn.start () Conn.connect () qi = '/ queue /% s'% q Ueuename print "line [% s]"% qi print "subscribe:% s"% conn.subscribe conn.subscribe (destination = qi, id = 123421 , Ack = 'auto') while 1: time.sleep (2)
posting After about 30 minutes .. should be a message on the method
This was an example of the code that I modified and was not correct.
Make that change and it works fine.
Comments
Post a Comment