Server part of server to client communication implementation.
Please do not forget before use to:
- get up and running RabbitMQ
- create
user-notifytopic exchange - get up and running
rabbitmq-ub-routerandrabbitmq-jwt-issuerservices - configure
application.customSettings.rabbitMQsection - configure
uiSettings.adminUI.amqpNotificationUrl
Methods
broadcast(topic: string, message: object)→numberinner#
Send broadcast notification, to all connected clients
Return:
Event ID
entityEvent(entityName: string, instanceID: number, message: object, optionsopt: UBNotifyEntityEventOptions)→numberinner#
Send a notification about change to client
notifyUser(subjectIDs: number, message: object, subTopicopt: string)→numberinner#
Send notification to a particular user (subject).
Return:
Event ID
Arguments info:
subjectIDs: numberIf not specified, will be passed to
Session.uData.userID. subjectID of the message recipient: UnityBaseuserIDORroleIDorgroupIDIf ORG model is used, could also bestaffUnitIDordepartmentIDororganizationID,message: objectThe event data object to send, value is converted to JSON string before sending
subTopic: stringname of the notification source this should be unique name to be able for client to distinguish the source of notification message