axon with rabbitmq and spring: what is the eventprocessor name

92 views
Skip to first unread message

Jan Galinski

unread,
Jun 19, 2017, 1:51:45 PM6/19/17
to Axon Framework Users
I am using the distributing events scenario.

when in the documentation it says:

// in an @Configuration file:
@Autowired
public void configure(EventHandlingConfiguration ehConfig, SpringAmqpMessageSource myMessageSource) {
    ehConfig.registerSubscribingEventProcessor("myProcessor", c -> myMessageSource);
}
what is "myProcessor"? How do I link a concrete spring-bean (@Component) with my 
@EventHandler annotations to be used with SpringAMQP Messaging?

Allard Buijze

unread,
Jun 20, 2017, 2:22:19 PM6/20/17
to Axon Framework Users
Hi,
the "myProcessor" is the name given to the specific processor that should read from that source. You will also need to assign (some of) your event handler beans to that processor.

By default, each handler is assigned to a processor with the name of the handler's package. Processors are automatically created as soon as a handler is assigned to it.

So if you have a class (with @EventHandler annotated methods) called com.mycompany.myapp.SomeHandler, it is assigned to a processor "com.mycompany.myapp". 
If you then  
    ehConfig.registerSubscribingProcessor("com.mycompany.myapp", c-> myMessageSource)
the handlers in that class with be triggered for events from the "myMessageSource".

You can override how handlers are assigned to processors with the @ProcessingGroup, or by setting assignment 'rules' in the EventHandlingConfiguration.

Hope this helps.
Cheers,

Allard

--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jan.ga...@holisticon.de

unread,
Jun 21, 2017, 5:14:09 PM6/21/17
to Axon Framework Users
Thanks, Allard!
Reply all
Reply to author
Forward
0 new messages