Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note: Currently we are using simple username/password authentication between the YOUnite UI and AMQ. All interaction between zones and clients that are tied to zones (e.g. YOUnite UI) should interact with AMQ with OAuth tokens or even better SSO→OAuth.  See YOUMDM-103.

...

Subscribing to Topics

MDM uses the Apache ActiveMQ messaging system which leverages the STOMP text-based messaging protocol.  STOMP allows clients to be written easily.  A STOMP protocol implementation in node.js can be found here.

Adding STOMP

Add the following libraries in your local workspace:

...

Note: Hari is working on inserted the STOMP libraries into the project . There may be some changes to the following using npm to install the libraries.

...

Injecting STOMP Libraries

Directly add to the library section of your source code e.g. (use the appropriate path to your libraries):


Code Block
{src: `${this.ASSETS_SRC}/vendor-libs/js/amq_jquery_adapter.js`, inject: true, vendor: true},
{src: `${this.ASSETS_SRC}/vendor-libs/js/amq.js`, inject: true, vendor: true},
{src: `${this.ASSETS_SRC}/vendor-libs/js/stomp.js`, inject: true, vendor: true},


Subscribing to a Topic

Setup your credentials in your configuration (e.g. config.ts)

...

Code Block
this.client.disconnect();

Notification Event Types

The following is list of event types that a subscriber can be notified of on a per zone (topic) basis.  Each time an event is triggered it publishes a new notification of a given event type  .  

EventEvent TypeDefault ScopeAdditional Payload
A zone is createdZONE_POSTALLnone
A zone is updatedZONE_PUTALLnone
A zone is deletedZONE_DELETEALLnone
A zone's thumbnail image is updated (TBD)ZONE_THUMBNAIL_PUTALLTBD

A data domain is created or a new version of

of the data domain has been created

DOMAIN_POSTALLTBD

A data domain has been created

DOMAIN_PUTALLTBD
A data domain has been deletedDOMAIN_DELETEALLTBD
An MDR has been created for a given data domain (TBD)DOMAIN_NAME_DATA_POSTALLTBD
An MDR has been updated in a given data domain (TBD)DOMAIN_NAME_DATA_PUTALLTBD
An MDR has been deleted in a give data domain (TBD)DOMAIN_NAME_DATA_DELETEALLTBD


Notification Event Response Body

Notification responses include The notification's JMS header includes the following (WORKING: currently only the description is returned Mayank is resolving this YOUMDM-109):

keyvalue
descriptionA full description of the event - i.e. a full concatenation of the information described below for easy displaying.
changeVersionThe resources change version.
createdDateThe date the resource was created.
NameThe resource name
message-idThe JMS message ID.
dateCreatedUnix timestamp of when the event notification was sent

uuid

Zone uuid of target resource
eventTypeOne of the above described "Notification Event Types"
zoneNameoriginatorNameThe name of the zone that generated the event.
zoneUuidoriginatorUuid

The UUID of the zone that generated the event.

timestampThe time the notification was created.
optionalOther key/values that are appropriate for the event notification type


Requesting Notification Log

A client can make a request to get the log history for all notifications sent to their zone.  The user provides their zone and a from and to date.

...