Communicating with Message Bus
The YOUnite API server (API), YOUnite adaptors, and YOUnite UI communicate with each other using JMS. JMS messages are sent via the Message Broker.
Use the following steps to configure JMS communication:
- Update the docker-compose files so that
ACTIVE_MQ_URI
uses the SSL connector:ACTIVE_MQ_URI=nio+ssl://openmdm-amq:61617
If you are running the API outside of Docker, then update the properties file (application.properties)
activemq.broker.uri
property using the above mentioned URI. - Add the broker certificate to the trust store for the API:
keytool -
import
-alias broker -keystore client.ts -file broker_cert
Since the only purpose of this certificate is to support SSL/TLS, we are not using a certificate signed by a CA. - Update the
ENTRYPOINT
in the Dockerfile to include the path to the trustStore:-Djavax.net.ssl.trustStore=/opt/certs/client.ts
If you are running the API outside of Docker, then add the above to the command line.
Naming Convention for Message Queues and Topics
- Names are of the form: <producer><consumer>-<Type>-[UUID]
- Producer and consumer can be either adaptor or router:
- The letter 'A' is used to denote Adaptor
- The letter 'R' is used for Router
- Type can be either:
- Data: For sending messages of type data or errors that are related to the data exchange.
- Ops: For sending operational messages like State information.
- UUID is used to identify the consumer of the messages, and is left blank if there is only a single instance of the consumer as in case of router. For example, if the consumer is
adaptor
, then the UUID for that adaptor is used. For a topic that may have multiple consumers the UUID field is used to specify the scope or zone subtree that consumers may belong to. Topics intended for all use the UUID of "root".
Queue and Topic Names
Using the conventions above, the following list describes the topics and queues used by the YOUnite MDM:
RA-Ops-root
: Topic for communicating operational messages, for which the producer is the router and consumers are all the adaptors in the subtree below root (which is the entire tree).RA-Data-
UUID: Queue for communicating data and data related errors from the router to an adaptor uniquely identified by its UUID.AR-Data
: Queue for communicating data and data related errors from an adaptor to the router.AR-Ops
: Queue for communicating operational messages from and adaptor to the router.