Home > Software engineering >  How to capture group specific messages with OutputDestination?
How to capture group specific messages with OutputDestination?

Time:05-14

We have integration tests that end up dispatching many messages on the same destination, but many different groups. In rabbitMQ terms, same exchange with different topics.

spring.cloud.stream.bindings.userEdited-out-0.destination=user.exchange
spring.cloud.stream.rabbit.bindings.userEdited-out-0.producer.routing-key-expression='user-edited.v1'
spring.cloud.stream.bindings.userEdited-out-0.content-type=application/json

spring.cloud.stream.bindings.userCreated-out-0.destination=user.exchange
spring.cloud.stream.rabbit.bindings.userCreated-out-0.producer.routing-key-expression='user-created.v1'
spring.cloud.stream.bindings.userCreated-out-0.content-type=application/json

I have been successful with reading these messages using OutputDestination, but it appears that I'm only able to pull messages sent to a destination (exchange), and not able to also filter by the group (topic) it was sent to.

Is there any way to pull messages from the OutputDestination by destination and group?

CodePudding user response:

That is correct and is by design, since grouping is specific to a binder implementation (i.e., rabbit) OR part of native functionality of the broker (kafka). So the test binder is designed to ensure that all core components involved in receiving and sending messages are tested.

  • Related