I'm trying to create a simple microservices project to learn working with the Axon Framework.
I've set up messaging through RabbitMQ with the following code:
@Bean
public Exchange exchange() {
return ExchangeBuilder.fanoutExchange("Exchange").build();
}
@Bean
public Queue queue() {
return QueueBuilder.durable("QueueA").build();
}
@Bean
public Binding binding() {
return BindingBuilder.bind(queue()).to(exchange()).with("*").noargs();
}
@Autowired
public void configure(AmqpAdmin admin) {
admin.declareExchange(exchange());
admin.declareQueue(queue());
admin.declareBinding(binding());
}
And the folling in my application.properties:
axon.amqp.exchange=Exchange
With this configuration all events published through the Axon Framework will be sent to QueueA. But now I want to make all EventA events go to QueueA and all EventB events go to QueueB. How can I do that?