Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not able to connect to activemq broker of aws active mq #377

Open
Dhyanesh97 opened this issue Apr 25, 2022 · 1 comment
Open

not able to connect to activemq broker of aws active mq #377

Dhyanesh97 opened this issue Apr 25, 2022 · 1 comment

Comments

@Dhyanesh97
Copy link

Dhyanesh97 commented Apr 25, 2022

code:

import stomp
#Establish a connection
con = stomp.Connection([('stomp+ssl://xxxxxxxxxxxxxxxxxx.mq.xxxxxxxxxxxxxxxx.amazonaws.com',61616)])
#listener class to be instantiated.
class Listener(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)
con.set_listener('', Listener())
#wait will ensure it waits till connection is established and acknowledged.
# con.start()
con.connect('xxxxxxxx', 'xxxxxxxxx', wait=True)
#subscribe to a particular topic or queue by giving the path and headers if required by the server.
con.subscribe('#', headers={})

Error:

Could not connect to host stomp+ssl://xxxxxxxxxxxxxxxxxxxx.mq.xxxxxxx.amazonaws.com, port 61616
Could not connect to host stomp+ssl://xxxxxxxxxxxxxxxxxxxx.mq.xxxxxxx.amazonaws.com, port 61616
Could not connect to host stomp+ssl://xxxxxxxxxxxxxxxxxxxx.mq.xxxxxxx.amazonaws.com, port 61616
Traceback (most recent call last):
  File "stomp_mqtt_subscribe.py", line 34, in <module>
    con.connect('xxxxxxxx', 'xxxxxxxx', wait=True)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/stomp/connect.py", line 150, in connect
    self.transport.start()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/stomp/transport.py", line 130, in start
    self.attempt_connection()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/stomp/transport.py", line 834, in attempt_connection
    raise exception.ConnectFailedException()
stomp.exception.ConnectFailedException

Any help appreciated.

@regisfbrilhante
Copy link

regisfbrilhante commented Jul 19, 2022

have you tried use set_ssl?

conn.set_ssl(hosts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants