node.jsrabbitmqnode-amqplib

Set connection name with amqplib


I need to set a friendly name for my connection as below instead of "?" in RabbitMQ for amqplib for NodeJS:

enter image description here

I found examples with Java and Python but nothing yet with this library. Thanks.


Solution

  • Yes you can set the connection name by passing it in the client properties:

    amqp.connect('amqp://localhost', {clientProperties: {connection_name: "myFriendlyName"}})
    

    enter image description here

    For reference:

    https://github.com/squaremo/amqp.node/issues/217