I need to bind single queue with multiple routing keys.
I have configuration in application.properties:
spring.cloud.stream.bindings.some-channel1.de
You can't do it with stream properties, but you can always add extra bindings with normal Spring AMQP declarations...
@SpringBootApplication
@EnableBinding(Sink.class)
public class So50526298Application {
public static void main(String[] args) {
SpringApplication.run(So50526298Application.class, args);
}
@StreamListener(Sink.INPUT)
public void listen(String in) {
System.out.println(in);
}
// extra bindings...
@Bean
public TopicExchange exch() {
return new TopicExchange("exch");
}
@Bean
public Queue queue() {
return new Queue("exch.a-queue");
}
@Bean
public Binding extraBinding1() {
return BindingBuilder.bind(queue()).to(exch()).with("event-domain2");
}
}
There is also a third party "advanced" boot starter that allows you to add declarations in a yaml file. I haven't tried it, but it looks interesting.