For some applications, capturing registration and modification events from Compound Registration plays an important role. Applications that are downstream consumers of these events have two ways to extract messages from the system:
23.8.0-2306091339
)To choose between the two downstream modes, set the RegDownstreamMode
registry property:
RegDownstreamMode=ActiveMQ
will enable JMS downstream (default option)RegDownstreamMode=Database
messages will be permanently stored in the DOWNSTREAM_MESSAGE
table and the message query HTTP API becomes availableTo enable downstream message publishing or change the structure format, set the RegDownstreamPublishEnabled
and RegDownstreamFusedImageFormat
registry properties:
Property name | Example value | Description |
---|---|---|
RegDownstreamPublishEnabled | true | This enables downstream message publishing |
RegDownstreamMode | ActiveMQ | The active downstream mode. It can be ActiveMQ or Database (case sensitive) |
RegDownstreamFusedImageFormat | mol:V3 | This option changes the structureWithSalt image format in the message (other examples: mrv, base64:svg) |
These can be provided via the registry.properties
file (war deployment) or as environment variables (docker deployment).
ActiveMQ is a popular open-source, Java based message broker. It is responsible for seamless communication between a producer and one or multiple consumers. In version 21.3.0-2103251330
, several new properties were introduced in Compound Registration to support connecting to remote ActiveMQ brokers.
The message flow between the producer and the consumer is asynchronous. Compound Registration generates, and with the use of the JMS protocol it publishes messages to the broker. From that point, the rest of the delivery process is up to the broker and the consumer.
Here is a short overview of the messaging architecture:
The message format is XML, and it contains all version and lot level compounds that belongs to the parent compound where the registration or modification event happened. At the following link, you can find an example message.
Any message will disappear from the broker if the consumer successfully received it. It can be useful to send some messages again or synchronize the full compound library. For that the following APIs can be useful:
/downstream/publishAll
/downstream/publishTrees
/downstream/status
In order to connect to a JMS compatible message broker, the following properties are needed:
Property name | Example value | Description |
---|---|---|
RegDownstreamJmsPersistent | true | If enabled, messages are persisted to disk/database so that they will survive a broker restart |
RegDownstreamJmsDestinationName | REGISTRATION.DS | Destination queue name(s). If you have multiple DS clients, add one for each of those in this format: RegDownstreamJmsDestinationName=REGISTRATION.DS1,REGISTRATION.DS2 and configure the clients to use their dedicated queue |
RegDownstreamJmsBrokerURL | tcp://compreg-broker-host:61616 | The URL of the message broker |
RegDownstreamJmsUser | compreg | This will be used by the application to connect to the message broker |
RegDownstreamJmsPassword | qu28HDK4uE1Q | The password for RegDownstreamJmsUser |
The Downstream API listens to the same events as it's ActiveMQ counterpart, but there are some differences between the two:
Here is a short overview of the messaging architecture:
message-1
and message-2
were already present in the system.Accessing messages:
GET [http|https]://<host>:<port>/RegistryCxn/rest/downstream/messages?fromId=<fromId>&limit=<limit>
fromId
:
limit
:
DOWNSTREAM
roleNotes:
The message format is JSON, and it contains all version and lot level compounds that belongs to the parent compound where the registration or modification event happened. At the following link, you can find an example message.