Following errors I am getting in a single stack trace. Want to know where did I go wrong.

org.springframework.amqp.rabbit.listener.QueuesNotAvailableException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it.

org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[service-myInputChannelName]

com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'service-myInputChannelName' in vhost '/', class-id=50, method-id=10)

For my input channel, I have done following configuration

spring:
  cloud:
    stream:
      binders:
        mqtt-binder:
          type: rabbit
          defaultCandidate: false
          inheritEnvironment: true
          environment:
            spring:
               rabbitmq:
                  virtual-host: mqtt
      bindings:
        myInputChannelName:
          destination: myInputChannelName
          group: service-myInputChannelName
          content-type: application/json
          consumer:
            concurrency: 10
            maxAttempts: 1
      rabbit:
        bindings:
          myInputChannelName:
            consumer:
              queueNameGroupOnly: true
              prefetch: 5
              ttl: 600000
              bindQueue: false

Java Code

@Input("myInputChannelName")
SubscribableChannel myInputChannelNameEvent();

Dependency: org.springframework.cloud:spring-cloud-starter-stream-rabbit:3.2.4

1

There are 1 answers

1
Gary Russell On

It is not clear what you expect in this case; bindQueue=false is intended for cases where you want to use a queue that you have defined and bound yourself.

By default, the binder will create the infrastructure that it needs.

If you set it to false, you have to set it up yourself.