ProcessCommand#Axon

Hi,
I’m sending command from microservice A to B, When receiving the command in microservice B I want to do some process of the command before dispatching it to the commandHandler and i don’t want to add and inject services that processes the command in my aggregate of microservice B exactly in the command handler . I thought about implementing external command handler but i was blocked in publishing an event to my aggregate via AggregateLifeCycle.apply() that can be do only in the aggregate itself not in the command handler. I look for some ideas.
Thank You

Nouha

Hi, You can use command interceptor before dispatching the command to command handler.

Hi ,
There is one provided by axon you can read in doc at this
link https://docs.axoniq.io/reference-guide/v/3.3/part-iii-infrastructure-components/command-dispatching#dispatch-interceptors

Hi,
Thank You Aswani, as you mentioned, you mean CommandHandlerInterceptor not DispatchInterceptors, but I think can I publish an event from a non aggregate via eventGateway from Microservice A , and can I catch this event via the event handler of Microservice B (NB I send via Event Gateway no via aggregateLifeCycle.apply())?
Thank You
Nouha