SMART COSMOS Event Service
The SMART COSMOS Objects Event Service is designed to provide an easier entry point for services that do not want to implement the dependencies required to publish messages into a message bus. Moreover, this abstraction enables a greater level of customization for what constitutes the message bus. Lastly, this also provides a non-JAVA entry point for publishing events.
Right now this service takes advantage of consumer subscription groups capable in RabbitMQ enabling a high scalability, fault tolerant mechanism for exchanging events.
Publishing to the Event Bus
Most services are automatically configured with the @EnableSmartCosmos
to push events to the service registered as smartcosmos-events
in the cluster. As long as this service (or the service designed to replace it) uses that key, then events will be POST to an endpoint at this location. Events that correspond to the following format will be injected into the message bus:
{
"eventType" : "String", // (1)
"accountUrn" : "String, Optional", // (2)
"userUrn" : "String, Optional", // (3)
"data" : {} // (4)
}
-
The Event Type, is a String that allows flexibility from developer, although there are several default events featured in
DefaultEventTypes
-
Account that this event is tied to (if applicable)
-
User that this event is tied to (if applicable)
-
Actual event data
Watching the Event Bus
Since the messages are sent to rabbitmq, you can watch what is happening with the RabbitMQ Admin GUI