Using Ingress Message Plug-Ins
By default, the PubSub+ Cache service facility caches all live data messages that it receives on a topic, subject to its configured constraints. However, the Ingress Message Plug-In can be used so that live data messages received for a topic can be inspected and then processed according to criteria defined in a shared library before a PubSub+ Cache Instance caches or discards them. This allows only those messages that meet specific customer-defined criteria to be cached.
When an Ingress Message Plug-In is enabled, PubSub+ Cache passes a special‑purpose data structure (solCache_pluginEventInfo_t
) to the Plug-In function (solCache_plugin
) used by the dynamically shared library. The solCache_plugin
function can examine the contents of an ingress live data message, optionally modify or replace the message (using the standard Solace C API message parsing/processing functions), and then return an operation code (solCache_opcode_t
) to the PubSub+ Cache Instance that instructs it to do one of the following actions:
- cache the message
- flush the cache contents for the topic, then cache the message
- flush the cache contents for the topic, then discard the message
- discard the message
- discard the message, and then act as if a message loss was detected
The following example shows how the Plug-In can process ingress live data messages.
Ingress Plug-In Operation
Cache flush operations affect in-progress cache requests. A cache request may retrieve pre- and post-flush data if the flush occurs while a PubSub+ Cache Instance is sending the response to a request.