rabbit.js icon indicating copy to clipboard operation
rabbit.js copied to clipboard

specifying custom options/headers when sending messages

Open kpe opened this issue 11 years ago • 6 comments

it would be nice, if the rabbit.js API provides a way to specify custom AMQP headers when sending messages, i.e. pass custom options to methods like sendToQueue(). Something like passing an additional message options parameter to write/publish.

kpe avatar Aug 26 '14 12:08 kpe

Which headers/properties? You might be better off using squaremo/amqp.node directly -- it's not much more complicated that rabbit.js.

squaremo avatar Aug 28 '14 07:08 squaremo

Example uses that I would want header support for:

  1. User authentication
  2. Cross-Queue Auth
  3. Cross-Service Auth It seems like something that an abstraction would want considering it is a common feature for most message queues.

CalebMorris avatar Nov 17 '14 22:11 CalebMorris

I agree, I'm trying to connect to an existing RabbitMQ server and getting a 403:

Error: Handshake terminated by server: 403 (ACCESS-REFUSED) with message "ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile."

I'm not seeing anything in this repo that would allow me to authenticate a connection. I'll look at amqp.node.

jcollum avatar Jun 19 '15 21:06 jcollum

I'm not seeing anything in this repo that would allow me to authenticate a connection.

The createContext procedure allows you to supply a connection URL, and this takes the form given in http://www.rabbitmq.com/uri-spec.html. If you need to supply a username and password, use something like "amqp://user:pass@host".

squaremo avatar Jun 20 '15 22:06 squaremo

That did it thanks

jcollum avatar Jun 21 '15 00:06 jcollum

Funny, I'm back to this question; if I want to add a header like "message_id" (with a GUID value) should I upgrade to the AMQP.Node library? I'll give it a shot...

jcollum avatar Aug 18 '15 18:08 jcollum