Polyglot services with Axon

Hi - I would like to have the ability to create event-driven services using potentially multiple different languages - Java, Go, NodeJS, etc…

For the Java-based services, I would like to use Axon. Has anyone attempted integrating other services written in other languages with Axon (mainly at the eventing layer)?

Thanks,
John

Hi John,

welcome back :wink:
I was hoping to find some other responses here. I am sure there are others with multi-lingual experience around.

I have been involved in a couple of projects that required events to be shared with .NET applications, as well as some NodeJS. At that time (there was no AxonServer yet), we published events to RabbitMQ, from where these applications would read the event.
In general, serializing events to JSON (using the Jackson serializer) makes them very suitable for parsing in other languages. However, especially for the meta-data, you might want to tune things a bit. In the RabbitMQ publisher, but also in the KafkaPublisher (work in progress, currently 4.0-M2), you can specify a Converter, which converts the Axon format (Payload, MetaData and certain message details) to RabbitMQ format (payload, headers) and vice versa. You can provide a converter that better matches the format you want to use across your services.

To consume Events within Axon from different sources, you can use the same converter, but on the RabbitMQ message source (or whichever other component that you’re using).

Nowadays, you can also use AxonServer directly. The APIs to AxonServer are based on gRPC. While we currently only have Java clients (usable with and without Axon), it is fairly straightforward to also generate stubs in the different languages that gRPC supports. We do have plans to support clients for other languages, but it is not a priority for the short term.
This approach would allow for a more complete integration across components.

Hope this helps.
Cheers,

Allard