light-tram-4j is a port from eventuate-tram-core built by Chris Richardson. The client
API is the same but implemented not in Spring framework but light-4j instead.
There are three frameworks in light-platform focus on event driven microservices and
light-tram-4j is the most fundamental one. Tram stands for transactional messaging and
it enables an application atomically update state and send a message or a domain event
as part of an database transaction. Tram is a framework of ensuring data consistency
within a microservices architecture.
light-tram-4j provides several messaging abstractions:
messages - send and receive messages over named channels
events - publish domain events and subscribe to domain events
commands - asynchronoously send a command to a service and receive a reply
How it works.
Tram messaging implements the Application events pattern. A message producer inserts
events into an OUTBOX table as part of the ACID transaction that updates data, such as
JPA entities. A separate message relay (a.k.a. CDC service) publishes messages to the
The message relay works in one of two ways:
Transaction log tailing - currently implemented for MySQL
Polling - for other databases such as Oracle, Postgres
Todo list A Todo list application, which publishes domain event using light-tram-4j
light-tram-4j has the same dependencies as light-eventuate-4j on Kafka, Zookeeper and
Mysql. This must be started first before starting the CDC server below. The easiest way
to start all of the services is a docker-compose which is included in light-docker
For step by step guide, please refer to getting-started tutorial of light-eventuate-4j
Running CDC Server
In addition to a database and message broker, you will need to run the Tram CDC server.
It reads events inserted into the database and publishes them to Apache Kafka. It is
written using light-rest-4j. The easiest way to run this service during development is
to use Docker Compose file in light-docker.
Once the above docker-compose is up and running, we can start CDC server.
docker-compose -f docker-compose-cdcserver-for-tram.yml up