Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ: Queue not getting declared for one of the fanout queues #3084

Open
RaviTejaMaddhini2 opened this issue Feb 18, 2025 · 0 comments
Open

Comments

@RaviTejaMaddhini2
Copy link

Hi there, I am facing an issue with consumer declaration in the rabbitMQ fanout design, please take a look below details and let me know if there is any fix for this, thanks in advance.

I have the following configs for a fanout implementation:

Producer

spring.cloud.stream.bindings.sendUpdate-out-0.destination: update.v1.send-event
spring.cloud.stream.rabbit.bindings.sendUpdate-out-0.producer.exchange-type: fanout

consumer in service A

spring.cloud.stream.bindings.onABCUpdate-in-0.destination: update.v1.send-event
spring.cloud.stream.bindings.onABCUpdate-in-0.group: mail
spring.cloud.stream.rabbit.bindings.onABCUpdate-in-0.consumer.exchange-type: fanout
spring.cloud.stream.rabbit.bindings.onABCUpdate-in-0.consumer.dlqName: update.v1.send-event.mail.dlq
spring.cloud.stream.rabbit.bindings.onABCUpdate-in-0.consumer.auto-bind-dlq: true
spring.cloud.stream.rabbit.bindings.onABCUpdate-in-0.consumer.republishToDlq: true

#consumer in service B
spring.cloud.stream.bindings.onXYZUpdate-in-0.destination: update.v1.send-event
spring.cloud.stream.bindings.onXYZUpdate-in-0.group: sms
spring.cloud.stream.rabbit.bindings.onXYZUpdate-in-0.consumer.exchange-type: fanout
spring.cloud.stream.rabbit.bindings.onXYZUpdate-in-0.consumer.dlqName: .update.v1.send-event.sms.dlq
spring.cloud.stream.rabbit.bindings.onXYZUpdate-in-0.consumer.auto-bind-dlq: true
spring.cloud.stream.rabbit.bindings.onXYZUpdate-in-0.consumer.republishToDlq: true
`

The consumer in service A is working fine and it is the only consumer in that service. However, the consumer in B is not working and exists with two other consumers related to different functionality. To add service-B's queue to the fanout exchange I had to add the following config, which was is required in any other consumers we are having.

spring.cloud.stream.input-bindings:onXYZUpdate;

The consumer declaration is as follows:

@Bean public Consumer<TestMessage> onXYZUpdate(Strategy strategy) { return message -> { try { strategy.execute(message); } catch (Exception e) { LOG.error(e.getMessage(), e); } }; }

All the consumer declarations and the configs are similar, but an inbound queue is not getting declared for this consumer. I know that because the other two consumers in the service are logging the below log lines, but this one doesn't.

20:46:23.352 [main] [MEMBER_ID: ] [USER_ID: ] [] INFO RabbitExchangeQueueProvisioner.doProvisionConsumerDestination: [line:243] - declaring queue for inbound: <bindingName>.<group name>, bound to: <destination>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant