Skip to content

RabbitMQ reactive messaging. routing-keys configuration parameter doesn't affect incoming message processing. #48429

@andreiyusupau

Description

@andreiyusupau

Describe the bug

I'm using same Rabbit MQ queue and publish messages to the exchange for this queue with different routing-keys (and different structure).

Expected behavior

I expect that methods annotated with @Incoming should handle messages only with routing-keys specified in mp.messaging.incoming.<channel-name>.routing-keys

Actual behavior

@Incoming doesn't consider configured routing-keys, and messages are handled by both handlers distributing by round-robin principle.

How to Reproduce?

mp:
  messaging:
    incoming:
      foo:
        connector: smallrye-rabbitmq
        exchange:
          name: example.exchange
        queue:
          name:  example.queue
        routing-keys: example.queue.foo
      bar:
        connector: smallrye-rabbitmq
        exchange:
          name: example.exchange
        queue:
          name: example.queue
        routing-keys: example.queue.bar
    @Blocking
    @Incoming("foo")
    void onFoo(Message<Foo> message) {
        //do something
    }

    @Blocking
    @Incoming("bar")
    void onBar(Message<Bar> message) {
        //do something
    }

Output of uname -a or ver

Microsoft Windows [Version 10.0.26100.4061]

Output of java -version

Corretto 21.0.6

Quarkus version or git rev

3.22.1

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 8.12

Additional information

Is there some sort of misconfiguration? Or should I have only 1 handler (@Incoming) and handle messages with different methods based on routing-key in metadata manually?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions