Code Monkey home page Code Monkey logo

Comments (3)

bschmitt avatar bschmitt commented on July 3, 2024

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
php-amqplib/php-amqplib#358

from laravel-amqp.

outcaster avatar outcaster commented on July 3, 2024

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!

from laravel-amqp.

outcaster avatar outcaster commented on July 3, 2024

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 :).

from laravel-amqp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.