DiamondLightSource / blueapi

Apache License 2.0
6 stars 6 forks source link

Use default credentials from RabbitMQ Stomp plugin #348

Open DiamondJoseph opened 9 months ago

DiamondJoseph commented 9 months ago

If RabbitMQ Stomp plugin is configured with default user/pass, our connect frame does not need to include them and the Secret containing the Stomp password can be removed.

DiamondJoseph commented 9 months ago

Seems to not "just work" (by just omitting auth information)

INFO:blueapi.messaging.stomptemplate:Connecting...
INFO:stomp.py:established connection to host <HOST>, port 61613
ERROR:blueapi.messaging.stomptemplate:Failed to connect to message bus
Traceback (most recent call last):
  File "/scratch/blueapi/src/blueapi/messaging/stomptemplate.py", line 185, in connect
    self._conn.connect(
  File "/scratch/blueapi/venv/lib/python3.10/site-packages/stomp/connect.py", line 151, in connect
    Protocol11.connect(self, *args, **kwargs)
  File "/scratch/blueapi/venv/lib/python3.10/site-packages/stomp/protocol.py", line 339, in connect
    self.transport.wait_for_connection()
  File "/scratch/blueapi/venv/lib/python3.10/site-packages/stomp/transport.py", line 318, in wait_for_connection
    raise exception.ConnectFailedException()
stomp.exception.ConnectFailedException
callumforrester commented 2 months ago

This is also not a clear error message for when the connection fails due to an authentication error. Is that what this issue is about or should I make a separate one?