A message store is used to temporarily store messages before they are delivered to their destination by a message processor. This approach is useful for serving traffic to back-end services that can only accept messages at a given rate, whereas incoming traffic to the ESB arrives at different rates. To store incoming traffic in a message store, use the Store mediator, and then use a message processor to deliver messages to the back-end service at a given rate.
Multiple message processors can use the same message store. For example, in a clustered environment, each of the nodes would have an instance of the same message processor, each of which would connect to the same message store and evenly consume messages from it. The message store acts as a manager of these consumers and their connections and ensures that messages are processed by only one message processor, preventing message duplication. You can further control which nodes a message processor runs on by specifying pinned servers.
You can implement your own message store by implementing the
MessageStore interface and adding the store to the configuration. The ESB ships with the following message store implementations:
- In Memory Message Store
- JMS Message Store
- RabbitMQ Message Store
- JDBC Message Store
- Custom Message Store
Message Store Configuration
You enable a message store in the ESB configuration by adding the
<messageStore> element. This element is a top-level entry in the configuration and must have a unique name. The
class attribute value is the fully qualified class name of the underlying message store implementation, and the parameters section is used to configure the parameters that are needed by that implementation.
Message Store does not work in tenant mode. It is a limitation in the current implementation.