Axon Framework - how to consume multiple topics at axon query side

Can I configure multiple topics at query side. And map it to different event handling processor.

I’m not certain I understand your question. I’m not sure what you mean by “two different command events”. I think you may be saying that you have two distinct event emitting aggregate roots (or potentially command handling services, or one of each) and you want to have a single data store (query view) reflect the combined state.

There is nothing that would preclude you from doing this, however, I’m not sure it’s a standard practice. Of course it all depends on the details of what your doing and since you didn’t provide any details it’s going to be hard for anyone to be able to provide any real help/advice.

It could be that you are not sure what it takes to implement an event handling service (query model projector). If that’s the case it’s very simple. Below is a sample:

...

@Component
public class MyProjector {

  ...

  @EventHandler
  public void on(MyEvent event, @SequenceNumber long aggregateVersion, @Timestamp Instant occurrenceInstant) {
    // state persistence logic here
  }

  @EventHandler
  public void on(MyOtherEvent event, @SequenceNumber long aggregateVersion, @Timestamp Instant occurrenceInstant) {
    // state persistence logic here
  }

  ...
}

NOTE: there is nothing that enforces the packaging of the event types provided to the EventHandler methods, so there is nothing (outside of purposeful configuration you may apply to provide some isolation) precluding events from disparate sources being delivered to a single event handling component. If it makes sense for your project then you should be good to go.