Hi,
My team is happily using Axon Framework for a while now. Recently we’ve started a little side-project in NodeJS. I’m aware that there’s currently no NodeJS client available for Axon Server, so I’ve tried to establish some means of communication between our SpringBoot/Kotlin api <-> NodeJS project with the help of gRPC calls.
After some digging I’ve found this repo: https://github.com/MGathier/axonserver-nodejs. This was very helpful in getting started. I’ve managed to open a stream and receive some events for instance. However, I’m having trouble making query-request.
This is the toObject()
version of the call I’m making:
{
messageIdentifier: 'b244e593-74b7-4dcb-92ae-a64fe77ac0ee',
query: 'co.myapp.cqrs.SomeQuery',
timestamp: 1600956188831,
payload: {
type: 'co.myapp.cqrs.SomeQuery',
revision: '',
data: 'PGNsaWVudElkPmY1NTI1MmQ1LTMzY2UtNDk3NC1iNGE1LTIwNjY2MDQ5ZjI4MjwvY2xpZW50SWQ+'
},
metaDataMap: [],
responseType: { type: 'co.myapp.cqrs.SomeQueryResponse[]', revision: '', data: '' },
processingInstructionsList: [],
clientId: '30416@MacBook-Pro.local',
componentName: 'nodejs-axon’
}
The response:
{
messageIdentifier: '1c240136-f649-44ba-81e9-aebba99fc115',
errorCode: 'AXONIQ-5001',
errorMessage: {
message: "class org.axonframework.serialization.UnknownSerializedType cannot be cast to class org.axonframework.messaging.responsetypes.ResponseType (org.axonframework.serialization.UnknownSerializedType and org.axonframework.messaging.responsetypes.ResponseType are in unnamed module of loader 'app')",
location: '30091@MacBook-Pro.local',
detailsList: [
"class org.axonframework.serialization.UnknownSerializedType cannot be cast to class org.axonframework.messaging.responsetypes.ResponseType (org.axonframework.serialization.UnknownSerializedType and org.axonframework.messaging.responsetypes.ResponseType are in unnamed module of loader 'app')"
],
errorCode: ''
},
payload: undefined,
metaDataMap: [],
processingInstructionsList: [],
requestIdentifier: 'e7ca9db1-28f5-41a4-9d08-c62229be8680'
}
The query-handler looks like this:
@QueryHandler
fun handle(query: SomeQuery): Array<SomeQueryResponse> { }
I’ve tried setting various response-types, ie. Array<co.myapp.cqrs.SomeQueryResponse>
but none of them work.
Does anyone know how to get a successful response?