Skip to main content

Message Store

info

This API is currently in beta and available via KeySessionExperimental.

There are some typical use-cases we see are around configuration of applications. For example, you may want to have a master switch for your Autoquoter to enable or disable quickly. This would typically be controlled by an editable message which needs to be cached such that when your component initalises, it reads the state of that message and receives subsequent updates should it be edited.

System Persisted Messages are mutable messages owned by the KeySquare Platform (specifically managed by the Message Store component). Key features include:

  • Support for composing and editing System Persisted Messages within the KeySquare Workspace front end
  • Audit history of any change stored as a time-series
  • Flexible Message ownership and storage
    • This becomes especially useful for Excel users valuing schema flexibility and data ownership to be centralised such that multiple Excel users work off the same data

How to store System Persisted Messages

The session.store API supports:

  • SBEs
  • DTOs
  • POJOs
  • Maps
    // create a session
session = (KeySessionExperimental) KeySessionFactory.create(context);
...
session.store(msg, StoreMode.MESSAGE_STORE_OWNERSHIP);

The msg will be stored and published by the Message Store component. Note, these messages will survive Message Store restarts.

Application Persisted Messages

Application Persisted Messages provide for very similar use-cases to System Persisted Messages. The key difference is data validation and publication by the component. An application can store messages into the KeySquare Platform (again, via the Message Store component).

How to store Application Persisted Messages

    // create a session
session = (KeySessionExperimental) KeySessionFactory.create(context);
...
session.store(msg, StoreMode.APPLICATION_OWNERSHIP);

TODO How to load Application Persisted Messages