calling query-handler from a different service

i have multiple services running on different hosts and connected to a single instance of axon-server. i am able to shares events among all services. i.e., one service can fire an event and rest others are able to listen it.

i want the same for queries as well. i.e., many services will fire a query and one service will handle it. i tried doing this as follows:

  1. when i used queryGateway.query( query, responseType): i got queryhandler not found exception.
  2. when i used queryGateway.subscriptionQuery( query, initialResponseType, updateResponseType): i got empty result and the queryhandler not invoked.
  3. when i used queryGateway.scatterGather( findCourierByIdQuery, responseType, timeout, timeUnit): i got an empty stream and the queryhandler not invoked.
    When i fired the query from same service in which the query-handler is written then only the handler is getting invoked.

Now my question is whether query sharing among multiple services is allowed in axon like we do for events. if yes how to achieve it.

Can you share the Query Handler and the exact code you use to dispatch the query?

As soon as you connect your handler application to AxonServer, you should be able to see the application and the names of the queries it can handle in the Dashboard (normally on http://localhost:8024). Also make sure that both services use the same serializer for the messages.