spiral / roadrunner-bridge

🌉 RoadRunner bridge to Spiral Framework
https://spiral.dev/docs/packages-roadrunner-bridge
MIT License
12 stars 6 forks source link

Error when connecting to the rabbitmq queue #97

Open realization opened 9 months ago

realization commented 9 months ago

Description

Error when connecting to the rabbitmq queue:

ERROR: Unable to declare consumer pipeline "my_amqp". Reason: Error 'rpc_declare_pipeline:  jobs_plugin_declare: expected { character for map value' on tcp://127.0.0.1:6001 []

How To Reproduce

I created a CLI application with the "queue" & "road-runner" component. I decided to connect the rabbitmq queue (to exchange.type=topic).

in the file app/config/queue.php added the my_amqp array with queue settings to pipelines

...
        'my_amqp' => [  
            'connector' => new AMQPCreateInfo(  
                'main_queue',  
                exchange: 'app_events',  
                exchangeType: Spiral\RoadRunner\Jobs\Queue\AMQP\ExchangeType::Topics,  
                exchangeDurable: true,  
                queue: 'test-service',  
                durable: true,  
                requeueOnFail: true,  
                routingKey: 'event.*',  
            ),  
            'consume' => true  
        ],  

added rr-amqp to connections. example: code.tar.gz

Launched ./rr serve I see in the logs

[2023-11-09T16:56:27.544092+00:00] ERROR: Unable to declare consumer pipeline "my_amqp". Reason: Error 'rpc_declare_pipeline:   jobs_plugin_declare: expected { character for map value' on tcp://127.0.0.1:6001 []
[2023-11-09T16:56:27.544311+00:00] ERROR: Unable to declare consumer pipeline "memory". Reason: Error 'rpc_declare_pipeline: pipeline already exists, name: local, driver: memory' on tcp://127.0.0.1:6001 []
[2023-11-09T16:56:27.555059+00:00] ERROR: Unable to declare consumer pipeline "my_amqp". Reason: Error 'rpc_declare_pipeline:   jobs_plugin_declare: expected { character for map value' on tcp://127.0.0.1:6001 []

logs.tar.gz

Additional Info

Q A
Framework Version 3.9.1
PHP version 8.1.14
Operating system Debian GNU/Linux 11 (bullseye)
butschster commented 9 months ago

Hello! Could you show your .rr.yaml config ?

realization commented 9 months ago

Hello! Could you show your .rr.yaml config ?

version: '3'
rpc:
    listen: 'tcp://127.0.0.1:6001'
amqp:
  addr: amqp://admin:***@127.0.0.1:5672
jobs:
    pool:
        num_workers: 2
        max_worker_memory: 100
    consume: {  }
server:
    command: 'php app.php'
    relay: pipes
butschster commented 9 months ago

Could you provide RR version? Maybe do you have some var_dump executions in your code?

realization commented 9 months ago

Could you provide RR version? Maybe do you have some var_dump executions in your code?

[INFO] RoadRunner server started; version: 2023.3.3, buildtime: 2023-10-26T18:43:18+0000

I did not add "var_dump" to the project, I added edits only to the files: .rr.yaml, queue.php, .env