Closed dugjohnson closed 7 years ago
I'm not 100% sure but it has sth to do with the declaration of the queue. Can you post your config here?
hp-amqplib/issues/337 https://github.com/php-amqplib/php-amqplib/pull/358
Hi! apparently it seems I have the same issue, i have a consumer with this test code:
`public function handle() { \Amqp::consume('site', function ($message, $resolver) {
var_dump($message->body);
$resolver->acknowledge($message);
$resolver->stopWhenProcessed();
});
}`
This consumer is listening to a queue called 'site'. the plugin config is this one
`'properties' => [ 'local' => [ 'host' => getenv('RABBITMQ_HOST'), 'port' => getenv('RABBITMQ_PORT'), 'username' => getenv('RABBITMQ_USERNAME'), 'password' => getenv('RABBITMQ_PASSWORD'), 'vhost' => '/', 'connect_options' => [], 'ssl_options' => [],
'exchange' => getenv('RABBITMQ_EXCHANGE'),
'exchange_type' => 'topic',
'exchange_passive' => false,
'exchange_durable' => true,
'exchange_auto_delete' => false,
'exchange_internal' => false,
'exchange_nowait' => false,
'exchange_properties' => [],
'queue_force_declare' => false,
'queue_passive' => false,
'queue_durable' => true,
'queue_exclusive' => false,
'queue_auto_delete' => false,
'queue_nowait' => false,
'queue_properties' => ['x-ha-policy' => ['S', 'all']],
'consumer_tag' => '',
'consumer_no_local' => false,
'consumer_no_ack' => false,
'consumer_exclusive' => false,
'consumer_nowait' => false,
'timeout' => 0,
'persistent' => false,
],
],`
The queue has been declared from the rabbit mq admin with mostly default configuration, just set as "durable".
The consumer works fine, read and process the messages however in the last line of code, when it tries to close, i get
Call to a member function send_channel_method_frame() on null in /var/www/html/demo/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php:116
no clue about what could be causing this. any idea would be gladly appreciated thanks!
found the issue by myself, its related to the amqp-lib version that was installed on my server, i updated it to the latest version and the issue was gone :).
I'm just using this plug-in as a consumer in an Artisan Command of a RabbitMQ queue that is fed elswhere.
Everything reads correctly. At the end I get the following error
My code
I put in the try/catch to try to eliminate the console display, but that didn't change anything.
Any ideas of how to fix this would be appreciated