Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support friendly connection name when connecting #989

Closed
C-Duv opened this issue Mar 7, 2018 · 5 comments
Closed

Support friendly connection name when connecting #989

C-Duv opened this issue Mar 7, 2018 · 5 comments

Comments

@C-Duv
Copy link

C-Duv commented Mar 7, 2018

Since rabbitmq/rabbitmq-server#104, RabbitMQ clients can pass a "friendly connection name" to the server when connecting.
This is not a reliable identifier but is shown in the server's management web interface and can serve for debugging.
Can such feature be implemented in pika?

@lukebakken
Copy link
Member

This has been supported since this commit - 5dc90ad

@C-Duv
Copy link
Author

C-Duv commented Mar 7, 2018

Great. Sorry I didn't found it in the documentation. Thanks :)

Here is an example for anyone stepping here and as lost as I was:

parameters = pika.ConnectionParameters(
    'amqp.example.com',
    5672,
    virtual_host='/',
    client_properties={
        'connection_name': 'My foobar client',
    },
)
connection = pika.BlockingConnection(parameters)

@lukebakken
Copy link
Member

We would be happy to accept a pull request that improves the documentation and examples. Thanks!

@mauvilsa
Copy link

mauvilsa commented Apr 4, 2024

Hello. I want to use pika.URLParameters to create a pika.BlockingConnection. How to set connection_name in this case?

@mauvilsa
Copy link

mauvilsa commented Apr 4, 2024

Okay, figured it out:

connection = BlockingConnection(parameters=URLParameters("amqps://user:pass@hostname:5671/?client_properties={"connection_name":"name"}"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants