Event Manager¶
The Event Manager logic in MIKE OPERATIONS consists of two components
-
An Event Manager offering business layer functionality for sending and subscribing to events
-
A Windows Service activin as a post office or broker between senders and subscribers
The main purpose of the Event Manager and Event Manager Service is primarily to provide updated information about running jobs, but any process in MIKE OPERATIONS can act as sender and/or subscriber of events.
Every job being executed, will create an entry in the event manager table, so that other managers in MIKE OPERATIONS, can subscribe to job events.
Job Explorer, Operation Explorer and Scenario Manager are examples of UI components which subscribe to Job events for updating the status of running jobs in the UI.
If the Event Manager Service is not running, the UI will not update status of running jobs.
Concept and configuration¶
Figure 1 The Event Manager flow of events
A Sender sends events via the Event Service, which distributes the event to all subscribes, which have subscribed to the type of events. The Event Manager business layer which handles the communication to the Event Service will also ensure that the event is stored in the event table in the database.
Service, Senders and Subscribers may run in different machines. This means Senders and subscribes must have the same configuration of where the Event Service is running, and the Event Service have a similar configuration of how to run.
The configuration of all three components happens in the file DHI.Solutions.EventManager.Config in the MIKE OPERATIONS installation folder, see Figure 2
Figure 2 Default content of the Event Manager configuration file
By default an Event Service is started in each machine with MIKE OPERATIONS. It will communicate on port 8732 for setting up senders and subscribers and use a dynamic range of ports between 10000 and 11000 for the sending of events.
In a single machine setup this default configuration will ensure that JobRunner can send events and that MIKE OPERATIONS Desktop and MIKE Workbench receive these events from the Event Service.
In a multi-machine setup one machine should be designated Event Service and all config-files in all the participating machines should have the RemoteServiceAddress configured to point to a ip or machine name of the machine running the Event Service, e.g
\<add key="RemoteServiceAddress" value="10.90.59.20:8732"/>,
Opening ports¶
In some windows systems the ports may be blocked and the permissions to use them has to be added via a command line.
On the server:
- Ensure port 8732 is open for Incoming communication, by making an Incoming rule in the Windows firewall.
On the client:
-
Ensure the dynamic port range is open for Incoming communication, by making an Incoming rule in the Windows firewall.
-
Run command (maybe as administrator):
FOR /L %G IN (10000,1, 11000) DO netsh http add urlacl url=http://+:%G/DSSEventManager/EventSubscriber/ user="\<user name or group>"
The “\<user name or group>” is the windows notation of a user or group of users,e.g. “Statewater\CARMS_Users”
The Event Manager Table¶
The Event Manager has no separate UI, but only a business layer of functionality used by the senders and subscribers of events.
Once an event is sent (and received by subscribers) it will not be used by the system, but is kept in the database as the event manager will store received events in the event table mainly for tracking and debugging uses.
Event Manager Maintenance¶
The event manager table will grow in time. This means that maintenance of the table is recommended.
This can be done using the job task “ManageEventLog”. Refer to the job manager for more information on setting up the job task.