Category: Uncategorized

Eventuate Local: Event Sourcing and CQRS with Spring Boot, Apache Kafka and MySQL

Eventuate™  is a platform for developing transactional business applications that use the microservice architecture. Eventuate provides an event-driven programming model for microservices that is based on event sourcing and CQRS.

The benefits of Eventuate include:

  • Easy implementation of eventually consistent business transactions that span multiple microservices
  • Automatic publishing of events whenever data changes
  • Faster and more scalable querying by using CQRS materialized views
  • Reliable auditing for all updates
  • Built-in support for temporal queries

Eventuate™ Local is the open-source version of Eventuate™. It has the same client-framework API as the SaaS version but a different architecture. It uses a MySQL database to persist events, which guarantees that an application can consistently read its own writes. Eventuate Local tails the MySQL transaction log and publishes events to Apache Kafka, which enables applications to benefit from the Apache Kafka ecosystem including Kafka Streams, etc.

This diagram shows the architecture:

Eventuate Local currently only supports Spring Boot applications but we plan to add support for other frameworks and languages over time.

Learn more about Eventuate Local

To find out more about Eventuate Local:

Using Eventuate with @SpringBoot 1.3.3

If you use the Eventuate Java/Scala client framework with Spring Boot 1.3.3 (rather Spring Boot 1.2.x) you will encounter this exception:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.chrisrichardson.eventstore.subscriptions.config.EventStoreSubscriptionsConfiguration$$EnhancerBySpringCGLIB$$20370698]: Constructor threw exception; nested exception is java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase;
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
... 71 more
Caused by: java.lang.VerifyError: class com.fasterxml.jackson.module.scala.ser.ScalaIteratorSerializer overrides final method withResolved.(Lcom/fasterxml/jackson/databind/BeanProperty;Lcom/fasterxml/jackson/databind/jsontype/TypeSerializer;Lcom/fasterxml/jackson/databind/JsonSerializer;)Lcom/fasterxml/jackson/databind/ser/std/AsArraySerializerBase;
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

This exception is thrown because of an incompatibility between the version of jackson-module-scala used by Eventuate and the version of Jackson JSON used by  Spring Boot 1.3.3.

A later version of the Eventuate client will address this problem. In the meantime, you can fix the problem by defining the following dependency:

dependencies {
compile com.fasterxml.jackson.module:jackson-module-scala_2.10:2.6.3
}