Hello,
I’ve been working for some time now on migrating our applications from AF4 to AF5. Along the way I’ve already run into a number of bugs, and had been waiting for fixes in newer Axon versions.
Since we have several apps and I don’t want to deploy all of them as AF5 apps at once, I’m trying to run AF4 and AF5 apps mixed together. Of course that’s only meant to be temporary, but from my point of view it should fundamentally work for a reasonable migration.
I had most recently paused the migration because of Query Handlers returning `Optional` between AF4 and AF5 are incompatible · Issue #4744 · AxonIQ/AxonFramework · GitHub, since we have quite a few queries with Optional as the result. That issue has now been fixed in 5.2.1, so I wanted to continue migrating.
However, I immediately ran into the next query incompatibility. I’m surprised that apparently no one else has run into this problem, since from my perspective it’s really simple and basic.
We have QueryHandlers that return a List:
class CustomerFindPageQuery
data class CustomerDto(
val customerId: String,
val name: String,
)
@QueryHandler
fun handle(query: CustomerFindPageQuery): List<CustomerDto> {
return customers.values.toList()
}
When I call the query, I get different results for AF4 and AF5 clients:
AF5 client:
queryGateway.queryMany(
CustomerFindPageQuery(),
CustomerDto::class.java
)
=> full list of customers
AF4 client:
queryGateway.query(
CustomerFindPageQuery(),
ResponseTypes.multipleInstancesOf(CustomerDto::class.java)
)
=> only 1 element returned
I’m a bit puzzled that this doesn’t work, since almost every AF4 application querying against an AF5 QueryHandler would then have to be broken.
Of course, it’s a bit silly that I only spotted this problem now and not earlier, when I reported the issue with the Optional result. But I hadn’t actually gotten to these “real” queries in my testing before, because the Optional queries came first. Sorry, Steven
Did I misunderstand something? Is there a configuration option I’m missing? Or am I just a bit stupid? ![]()
Klaus