hi axon team,
i am trying to fetch Account details from Service-B where i am handling query by @QueryHandler. The query is fired from Service-A.
- it was working fine when i was not using EurekaDiscoveryClient .
- when i added eureka discovery client i added springCloudHttpBackupCommandRouter
and i added few configurations which can be found here https://groups.google.com/g/axonframework/c/RPfCE5Sqm3I , now i can able to handle commands and events between multiple services. - but i cannot handle Query request between multiple service.
- im scanning the packages where the QueryHandlers are present as specified by Allard, that didnt resolve the issue
please any one help me out solving this issue. below is my code snippet.
from Service A im firing the Query.
CompletableFuture account = queryGateway.query(
new AccountDetailsQuery(accountId), ResponseTypes.instanceOf( Account .class));
where AccountDetailsQuery will be in core-api and ll be added as jar file in both service-A and in Service B.
im handling that Query in Service-B using @QueryHandler
@QueryHandler
public Account getAccountDetails(AccountDetailsQuery query) throws Exception {
log.info(LoggingConstants.QUERY_INVOKE_LOG,query.getClass().getSimpleName());
return new Account(query.getAccountId(),“afffef”)
}
im scaning this package too.
@Bean
public QueryGateway getQueryGateway(SimpleQueryBus simpleQueryBus){
/Configurer configurer = DefaultConfigurer.defaultConfiguration();
QueryBus queryBus = configurer.buildConfiguration().queryBus();/
return DefaultQueryGateway.builder().queryBus(simpleQueryBus).build();
}
im getting excepton as
2020-08-13 18:45:14 [EventProcessor[AccountManagementSagaProcessor]-0] WARN o.a.c.gateway.DefaultCommandGateway - Command ‘com.xxx.xxx.core.api.AccountCommand’ resulted in java.util.concurrent.ExecutionException(org.axonframework.queryhandling.NoHandlerForQueryException: No handler for query: com.xxx.xxx.core.api.AccountDetailsQuery)
it would be helpful if anyone resolves this issue.
Thanks
Siddu