Skip to content

Unable to change exchange type when pushing to queue #302

Closed
@chinyoongtat

Description

@chinyoongtat

Hello,

I have declared an exchange with type = fanout

php artisan rabbitmq:exchange-declare fanout --type=fanout

I have also specified the exchange in my config\queue.php

         'options' => [
              'exchange' => [

                  // 'name' => env('RABBITMQ_EXCHANGE_NAME'),
                  'name' => 'fanout',

                  /*
                  * Determine if exchange should be created if it does not exist.
                  */
                  'declare' => env('RABBITMQ_EXCHANGE_DECLARE', true),

                  /*
                  * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html
                  */
                  'type' => env('RABBITMQ_EXCHANGE_TYPE', PhpAmqpLib\Exchange\AMQPExchangeType::FANOUT),
                  'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false),
                  'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true),
                  'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false),
                  'arguments' => env('RABBITMQ_EXCHANGE_ARGUMENTS'),
              ],
             'ssl_options' => [
                 'cafile' => env('RABBITMQ_SSL_CAFILE', null),
                 'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null),
                 'local_key' => env('RABBITMQ_SSL_LOCALKEY', null),
                 'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true),
                 'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null),
             ],
         ],

However, when i'm trying to push my job, I am hitting this error

PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'fanout' in vhost '/': received 'direct' but current is 'fanout'

Kindly help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions