Two rabbitmq queues with exactly same configuration one of them is not created automatically (Spring Boot 3 RabbitMQ)

23 Views Asked by At

I have 2 queues beans declared in one Spring Boot module, both queues have exactly the same configuration in Git. One of them is created automatically, but the second is not. Both queues have declared beans for publishers and consumers in the Spring Boot module.

When I'm debbuging the application only queueOne bean is created.

EventChannels contains constants with the channels names.

public static final String QUEUE_ONE= "queueOne";
public static final String QUEUE_TWO= "queueTwo";

Consumer beans:

@Bean(name = EventChannels.QUEUE_ONE)
public Function<Message<QueueOneEvent>, Void> queueOne() {
  return message -> {...};
}

@Bean(name = EventChannels.QUEUE_TWO)
public Function<Message<QueueTwoEvent>, Void> queueTwo() {
  return message -> {...};
}

Git configuration:

  cloud:
    function:
      definition: "queueOne;\
      queueTwo"
    stream:
      bindings:
        queueOne-in-0:
          destination: queue.one
          group: queue.one
          consumer:
            concurrency: 1
        queueOne-out-0:
          destination: queue.one
        queueTwo-in-0:
          destination: queue.two
          group: queue.two
          consumer:
            concurrency: 1
        queueTwo-out-0:
          destination: queue.two
      rabbit:
        bindings:
          queueOne-in-0:
            consumer:
              queueNameGroupOnly: true
              autoBindDlq: true
              prefetch: 5
              dlqDeadLetterExchange: queue.one
              dlqTtl: 86400000
          queueTwo-in-0:
            consumer:
              queueNameGroupOnly: true
              autoBindDlq: true
              prefetch: 5
              dlqDeadLetterExchange: queue.two
              dlqTtl: 86400000
0

There are 0 best solutions below