Вместо добавления требуемой группы, добавьте @Bean
s для двух обменов и @Bean
для привязки.
См. Документацию Spring AMQP .
@Bean
public TopicExchange destinatioExchange() {
return new TopicExchange("myDest");
}
@Bean
public DirectExchange boundExchange() {
return new DirectExchange("bound");
}
@Bean
public Binding binding() {
return BindingBuilder
.bind(boundExchange())
.to(destinatioExchange())
.with("myRoutingKey");
}
и
spring.cloud.stream.bindings.output.destination=myDest
spring.cloud.stream.rabbit.bindings.output.producer.routing-key-expression='myRoutingKey'