mich8bsp
mich8bsp

Reputation: 345

Embedding Lagom read-side processor in a non-Lagom application

I have a Lagom service which writes events for persistent entities to cassandra. I would like to process those events from another application (not lagom-based) by embedding a read-side processor which would connect to the same cassandra.

I did not find any documentation on how to embed lagom services or read-side processors into existing java/scala applications, is it possible?

Upvotes: 0

Views: 110

Answers (1)

Tim Moore
Tim Moore

Reputation: 9482

It isn't recommended to have multiple services sharing the same database. This causes tight coupling between the services and can make it hard to upgrade in the future.

Instead, you can use the Lagom Message Broker Topic Producer API to publish events to a Kafka topic. Then, you can consume these from another application, either using Lagom with the Message Broker Consumer API, or using any other Kafka client.

Upvotes: 1

Related Questions