user7422128
user7422128

Reputation: 932

unable to send message using STOMP to activemq

I am trying to use STOMP protocol to send message to my activemq but i am getting the below errors:

(limetray) Vaibhavs-MacBook-Air:Desktop vaibhav$ python receiver_topic.py heyhey
Unknown response frame type: ';activemq' (frame length was 11)
Unknown response frame type: '
                              ' (frame length was 2)
Unknown response frame type: ')' (frame length was 2)
Unknown response frame type: '
                              ' (frame length was 1)
Unknown response frame type: 'tcpnodelayenabled' (frame length was 20)
Unknown response frame type: 'sizeprefixdisabled' (frame length was 20)
Unknown response frame type: '  cachesize' (frame length was 11)
Unknown response frame type: '' (frame length was 1)
Unknown response frame type: '

I am using the below python script to send the message:

class MyListener(stomp.ConnectionListener):
    def on_error(self, headers, message):
        print('received an error "%s"' % message)
    def on_message(self, headers, message):
        print('received a message "%s"' % message)
hosts = [('localhost', 61616)]

conn = stomp.Connection(host_and_ports=hosts)
conn.set_listener('', MyListener())
conn.start()
conn.connect('admin', 'admin', wait=True,headers = {'client-id': 'clientname'} )
conn.subscribe(destination='A.B.C.D', id=1, ack='auto',headers = {'subscription-type': 'MULTICAST','durable-subscription-name':'someValue'})
#conn.subscribe({destination=config['/topic/test'], ack:'auto', 'activemq.subscriptionName':'SampleSubscription'})
#conn.subscribe(destination='/topic/testTopic', ack='auto', headers = {'activemq.subscriptionName': 'myhostname'})

conn.send(body=' '.join(sys.argv[1:]), destination='A.B.C.D')

time.sleep(2)
conn.disconnect()

Command used to call the script:

python receiver_topic.py heyhey

I think there is something need to be added to the activemq.xml file. Any suggestions on this would be really helpful.

Upvotes: 2

Views: 3016

Answers (1)

Tim Bish
Tim Bish

Reputation: 18356

From what little is provided it looks like you are connecting to the Openwire port on the broker which defaults to '61616' while the STOMP port is normally '61613' so my suggestion would be to check which port the STOMP connector is bound to and ensure you are connecting to that one.

Upvotes: 6

Related Questions