Skip to content

Show worker name in connections RabbitMQ admin management #487

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

Closed

Conversation

i3bepb
Copy link

@i3bepb i3bepb commented Oct 17, 2022

In console command exist options worker name. I suggest using this name in connections RabbitMQ admin management.

./artisan rabbitmq:consume --name="Consumer RaSmartId"

Now it looks like this:

Look bad

After change:

Look good

php-amqplib/php-amqplib#728

@everflux
Copy link

everflux commented Jan 1, 2023

Is there a reason not to user the AMQPConnectionConfig?
For example

 $config = new AMQPConnectionConfig();
 $config->setConnectionName("PHP-worker-node-1");
    $connection = new AMQPSSLConnection( 'localhost', 1234, 'guest',   'guest', '/', $ssl_options, array(), 'ssl', $config);

@i3bepb
Copy link
Author

i3bepb commented Jan 1, 2023

@everflux

Is there a reason not to user the AMQPConnectionConfig? For example

The method setConnectionName was added only in php-amqplib/php-amqplib 3.4, before it was not. I suggested changes before the release 3.4.

Now yes it is correct to use method setConnectionName

@@ -79,6 +79,9 @@ public function daemon($connectionName, $queue, WorkerOptions $options)

[$startTime, $jobsProcessed] = [hrtime(true) / 1e9, 0];

$phpAmqpLibConnection = $this->container['config']["queue.connections.$connectionName.connection"];
Copy link
Collaborator

@M-Porter M-Porter Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd want to only set the name if this config value is set and explicitly intended for such a purpose.

I'm not sure everyone would like to see \PhpAmqpLib\Connection\AMQPLazyConnection start appearing by default as the connection name in the UI.

@M-Porter
Copy link
Collaborator

Closing as resolved by #528

@M-Porter M-Porter closed this Jun 15, 2023
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

Successfully merging this pull request may close these issues.

4 participants