Hello,
I am using Axon server SE (version 4.5.3) and multiple standalone services (Spring apps) which are connected to the Axon server. Because I wish to get “build information” from each of the services I created a queryHandler in “common” package which is injected into each of the services. This way I have one code in one place.
When I send ScatterGather query I only receive one “build information” from only one service and the service is randomly chosen by the Axon. I tried to create a second queryHandler in one of the services and in this case ScatterGather returns two “build information” if the service is chosen by the Axon, otherwise it will return only one.
I use this call:
protected <T, V> List<T> scatterGatherMessage(V query, Class<T> responseClass) throws AxonCommunicationException {
QueryMessage<V, T> genericQueryMessage = new GenericQueryMessage<>(query, instanceOf(responseClass));
try {
return queryBus.scatterGather(genericQueryMessage, 10, TimeUnit.SECONDS)
.map(QueryResponseMessage::getPayload)
.toList();
} catch (CompletionException e) {
throw new AxonCommunicationException("Exception in Axon communication occurred.", e);
}
}
Could you please push me in the correct direction?
Thank you.