Hi,
I’m trying to develop a Milestone plugin for my own application and I use the AccessControl sample as an example.
In my plugin I have a background plugin running in the Event server where i connect to my own application server and wait for notification on my own systems variables.
When I receive a notification, I try to send an EventIndication to my Admin plugin to update its interface.
My problem is that I’m not receiving anything in my Admin plugin.
this is the code I use in my background plugin to send events:
EventSource eventSource = new EventSource()
{
FQID = _item.FQID,
Name = _item.Name
};
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Class = "NewEventToRule",
Type = "MyEventType",
Timestamp = DateTime.Now,
Message = "myEventMessage",
Name = "MyEventName",
Source = eventSource
};
EventSequence eventSequence = new EventSequence();
eventSequence.StartDateTime = DateTime.Now;
eventSequence.EndDateTime = DateTime.Now;
EventData eventData = new EventData()
{
EventHeader = eventHeader,
EventSequence = eventSequence
};
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewEventIndication) { Data = eventData });
and this is the code I use in the ItemManager of my Admin plugin to receive the events:
MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
_messageCommunication = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
_myAlarmReceier = _messageCommunication.RegisterCommunicationFilter(MyNewAlarmMessageReceived, new VideoOS.Platform.Messaging.CommunicationIdFilter(VideoOS.Platform.Messaging.MessageId.Server.NewEventIndication));
Am I doing something wrong??