Server part of server to client communication implementation.
Please do not forget before use to:
- get up and running RabbitMQ
- create
user-notify
topic exchange - get up and running
rabbitmq-ub-router
andrabbitmq-jwt-issuer
services - configure
application.customSettings.rabbitMQ
section - 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: UnityBaseuserID
ORroleID
orgroupID
If ORG model is used, could also bestaffUnitID
ordepartmentID
ororganizationID
,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