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

Request for Support to Set the connection_name Property #818

Open
Sanssouci-bit opened this issue Feb 26, 2024 · 1 comment
Open

Request for Support to Set the connection_name Property #818

Sanssouci-bit opened this issue Feb 26, 2024 · 1 comment

Comments

@Sanssouci-bit
Copy link

Hello,

While using the rabbitmq-c library to interact with RabbitMQ servers, I encountered a need to specify the connection_name property during the connection establishment. The connection_name is very useful for identifying and monitoring different client connections in the RabbitMQ management interface. Unfortunately, I noticed that the current version of the rabbitmq-c library does not seem to support setting this property directly.

After reviewing the documentation and the source code, I couldn't find a clear way to achieve this. Given the utility of connection_name and its support in other client libraries, I believe adding this feature to rabbitmq-c would greatly benefit developers using this library by providing more convenience and monitoring capabilities.

I would like to request a new feature that allows developers to specify a connection_name parameter when establishing a connection using amqp_open_connection or similar functions. This would not only enhance the functionality of the library but also make connections easier to manage and identify.

Thank you for considering this request. I look forward to your response.

@alanxz
Copy link
Owner

alanxz commented Feb 27, 2024

To specify a connection-name, you'll want to use the amqp_login_with_properties function when connecting to the broker, and provide a properties table with a key = connection_name and value with the name of the connection.

Constructing one may look like:

amqp_table_entry_t name;
name.key = amqp_cstring_bytes("connection_name");
name.value.kind = AMQP_FIELD_KIND_UTF8;
name.value.value.bytes = amqp_cstring_bytes("my-connection-name");

amqp_table_t properties;
properties.num_entries = 1;
properties.entries = &name;

amqp_login_with_properties(..., &properties...);

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

2 participants