0

I need to set the exchange and queue for RabbitMQ in my Spring Boot application, the thing is, The application only acts as a producer, but I need to define de queue as well in the service. steps that I did:

  1. set the @Input and @Output for my Queue and exchange.
  2. Define the bindings in application.yml (spring.cloud.stream.bindings and binders)
  3. develop the code to send the message using the @output method

When I run the application, the queue and exchange are in my RabbitMQ container, but when a message is received in the queue I have this error in my application:

Dispatcher has no subscribers for channel

Is it possible to set a queue using spring cloud stream without a listener? Only set the binding to set the queue in RabbitMQ

The spring cloud stream versions used is: 3.2.10 It's an old customer project.

Thanks in advance!

5
  • You must be using a very old version of spring-cloud-stream as @Input and @Output has log been deprecated and removed. Please read this section of the manual and feel free to follow up with more question docs.spring.io/spring-cloud-stream/reference/… Commented Oct 31, 2024 at 11:06
  • Thanks for your answer @OlegZhurakousky . Yes, I know, it's an old project that the customer has not updated yet. Intellij told me about this as well. Commented Oct 31, 2024 at 11:09
  • Well, it's no longer supported so I am not sure what else I can add as there is no code that corresponds to what you are asking about Commented Oct 31, 2024 at 11:11
  • Maybe if it's possible to set a queue in the service without listener. just to create the queue in RabbitMQ using the service?? Commented Oct 31, 2024 at 11:15
  • 1
    This is not what spring-cloud-stream is designed for. Consider looking at spring-amqp project Commented Oct 31, 2024 at 11:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.