Breaking Changes in MessageStore Release

The Eventide Project has released a breaking change update to the message store library and the message store Postgres library that all users should be aware of, but that few users will be affected by.

MessageStore::Postgres::Get Changes

The interface for MessageStore::Postgres::Get has changed such that the stream_name is now a construction parameter rather than an actuation parameter.

The previous interface was:

initialize(batch_size, condition)

self.build(batch_size: nil, session: nil, condition: nil)

call(stream_name, position: nil)

The new interface is:

initialize(stream_name, batch_size, condition)

self.build(stream_name, batch_size: nil, session: nil, condition: nil)

call(position)

In both cases, the class actuator remains the same:

self.call(stream_name, position: nil, batch_size: nil, condition: nil,  session: nil)

Since most users will only use the Get class actuator, if they ever use the Get class directly at all, it should only affect people who have developed custom tools which directly bind to the Get instance interface.

Concrete Get Implementations

There are now two concrete implementations of Get:

  • MessageStore::Postgres::Get::Stream
  • MessageStore::Postgres::Get::Category

Previously, on the MessageStore::Postgres::Get class existed, and it was used for both stream and category data access. Now, the raw Get implementation is an abstract module that the specialized implementations extend.

The constructor for Get will decide which concrete implementation to construct based on whether the stream name argument is a stream or a category:

get = MessageStore::Postgres::Get.build('someStream-123')
get.class
# => MessageStore::Postgres::Get::Stream

get = MessageStore::Postgres::Get.build('someStream')
get.class
# => MessageStore::Postgres::Get::Category

MessageStore::Postgres::Get::Last Changes

As a result of design corrections and the work done on the Get interface, the MessageStore::Postgres::Get::Last class has appropriately been moved into the Stream namespace.

The new namespace is:

MessageStore::Postgres::Get::Stream::Last

The interface for this class has not changed. Only its namespace has changed.

Note: There’s no MessageStore::Postgres::Get::Category::Last class as there’s no practical use case for retrieving the last message in a category.

Libraries Affected

Libraries in the Eventide stack that make use of the Get and Get::Last implementations have been updated in response to these changes.

The new releases are:

  • evt-message-store v1.1.0.0 (previous version: 1.0.1.2)
  • evt-message-store-postgres v1.1.0.0 (previous version: 1.0.0.1)
  • evt-consumer v1.1.0.0 (previous version: 1.0.2.0)
  • evt-consumer-postgres v1.1.0.0 (previous version: 1.0.2.0)
  • evt-entity_snapshot-postgres v1.1.0.0 (previous version: 1.0.0.0)

The account component example project has also been updated in response to these changes, and the Get::Last implementation is used in some of the component’s interactive test scripts.

Last Breaking Change Before the Eventide v2 Generation

These are the last expected breaking changes to the v1 product generation. There should be no more backward-incompatible releases before the v2 product generation is released at the end of 2019.

The clarification of design that results from these breaking changes will facilitate some of the changes that need to be made prior to the v2 work on the message store libraries.