I'm trying to use node-amqp.
When in the section of connection to rabbit an exception is thrown, I can get that exception but it restarts the connection to Rabbit forever.
Look at that:
amqp = require("amqp")
# Open a connection
conn = amqp.createConnection( {url: "amqp://localhost"} , {reconnect: true})
conn.on "ready", ->
console.log "Conn Ready"
conn.queue "queueX", {ack:true}, (queue) ->
console.log "Subscribed #{queue.name}"
assdsd() #calling non-exiting method. No exception is thrown but the connection is restarted
System loops on the errors thrown. I know this is because of {recconnect:true}. But I would like to be able to catch exceptions on my own. Any idea?
The output of my script is like this:
Conn Ready
Subscribed queueX
Conn Ready
Subscribed queueX
Conn Ready
Subscribed queueX
Conn Ready
Subscribed queueX
Conn Ready
Subscribed queueX
Conn Ready
Subscribed queueX
....