Closed jdlourenco closed 10 years ago
I assume you are running RMQ on 61613, correct? And that it is just the user/password that are "wrong credentials", correct?
I do not see an irb crash in your post. But the rmq.publish certainly fails. And your publish fails in the exact same way as it does here.
You are neglecting to check that open has actually succeeded.
So, .... after the Client.open, what is the output of
p rmq.connection_frame.command
?
If it is 'ERROR', your code needs to check for open errors (from the broker). And handle them according to your needs. Something like:
require 'stomp'
rmq = Stomp::Client.open 'user', 'pass', 'localhost', 61613 # wrong credentials
if rmq.connection_frame.command == "ERROR"
raise rmq.connection_frame.body
end
rmq.publish("/topic/test", "ol")
Please indicate if you require further assistance with this.
It is not a gem bug.
I am closing this issue, because no further comments have been received from @jdlourenco .
Re-open this, or create a new issue if you believe a gem bug actually exists.
Thanks.
When connecting to a RabbitmMQ broker (with the STOMP adapter enabled) with wrong credentials and trying to publish a message to a topic IRB crashes.
Here's what I am doing
And this is what I get:
Followed by IRB crashing.
Shouldn't the
Client.open
call return an error when it is provided with wrong credentials in the first place?I am using Ruby 2.1.2, stomp-1.3.2 gem and RabbitMQ 3.3.0, but I have also tested it with older ruby versions and got the same result.