-
Notifications
You must be signed in to change notification settings - Fork 22
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
Set client and connection name #1371
Comments
I'm not quite sure what to put for the connection name. Ideally it would be configurable, with a default that maybe includes the config name, maybe instance number, username |
if a give queue/consumer has two connections, should the id include something to tell them apart? "management" vs. "data" or just 1, 2? |
we open two channels (one for management, like checking the queue size, and one for getting messages), but they are both under a single connection. The connection is where this name gets applied. I did a quick search, but don't see a way to give a channel a name. They seem to get assigned numbers (e.g. connection_abc - channel 1, 2, 3, ...) sarracenia/sarracenia/moth/amqp.py Lines 248 to 249 in 3e1ccc0
Here's an example of how a connection looks. It shows the 2 numbered channels: |
oh... AMQP is so obtuse... channels vs. connections.. I got them confused. There's a reason MQTT is winning. OK so the way things are is good then? |
in MQTT, there are no queues... so we use the queueName to provide the connection-ID. I wonder if just using the queueName for the channel description is a good idea, then you don't need a separate setting, and it is likely to provide good info. |
for something like "for q_...." |
only works for subscribers though... need something else for publishers... hmm... |
We don't set any connection-id in publishers in mqtt. hmm... |
One thing that would be awesome to have is contact information, like an email address. It would have to be optional, but if users could set an email address in the config, and we could see it on the broker-side, that would be really useful. I guess that overlaps a bit with our need/desire to ensure contact information is present in our config files. |
a contact_email would be great! |
@andreleblanc11 noticed someone used a url in the property... so perhaps contact url is a good thing: maybe call it "contact_url" |
The git url's are for the "product" property... rather than the "connection name" ... |
In RabbitMQ, you can set both a name for a connection that will show up in light grey underneath the IP address in the RabbitMQ GUI. There's an example of what this looks like and how to set it using Pika here: https://stackoverflow.com/questions/58275505/how-to-set-connection-friendly-name-rabbitmq-python
And it looks like we can do it with the amqp library we are using as well: celery/kombu#1252
It seems easy enough to add here by adding
client_properties={'connection_name': 'foo'}
:sarracenia/sarracenia/moth/amqp.py
Lines 231 to 237 in 117e92a
It would also be nice to try to change the product name we are using. It currently shows up as
py-amqp
.Some users using Pika have a better client name:
It would be great if we could show the current Sarracenia version, like we set for the HTTP user agent.
sarracenia/sarracenia/transfer/https.py
Line 350 in 117e92a
I think we can also do this with client_properties, by setting
{ 'product': 'Sarracenia', 'product_version': sarracenia.__version__, }
https://github.com/celery/py-amqp/blob/b1f9c2e3d10c35601c9453a074bf8ae8dee9dd5b/amqp/connection.py
The text was updated successfully, but these errors were encountered: