The new global cache feature in WebSphere Message Broker V220.127.116.11 enables you to store and reference data in an embedded memory cache or an external WebSphere eXtreme Scale grid. This article shows you how to implement a global cache to store and access reference data for use by message flows.
Most enterprise IT solutions have a requirement for reference data that is accessed frequently during operations. Until recently, this reference data resided in either a file or a database and was accessed through queries. However, querying a file or database consumes time and must be done repeatedly, resulting in a substantial performance hit. To overcome this problem, applications started keeping reference data in a cache in memory, which greatly reduces the time needed to access the data.
IBM® WebSphere® Message Broker V18.104.22.168 (hereafter called Message Broker) provides various ways to manage the cache. You can use shared variables in ESQL to store the data in memory. But shared variables are private to a message flow and cannot be shared across message flows or execution groups, which can lead to duplication of stored data across different flows, and higher memory requirements to store the data.
Alternately, you can load static data into an execution group's JVM heap, so that the data can be shared by multiple flows deployed in an execution group. With this method however, the use of the data is confined to that execution group.
The new global cache feature in Message Broker enables a message broker application to store its reference data in an embedded or external WebSphere eXtreme Scale grid. In an embedded global cache, access to reference data is spread across multiple execution groups that host the eXtreme Scale container servers. The data can be accessed by all execution groups, even if they do not participate in hosting the container servers. This article shows you how to maintain and access static data in a global cache using Java routines from ESQL or Message Broker Mapping nodes.