in the smart client ViewItemUserControl i have a button who does this:
Item item = new Item(EnvironmentManager.Instance.MasterSite, AssemblyInfo.ProductName);
try
{
// Genera l'Evento per la Richiesta all'ES
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Class = "Operational",
Type = "",
Timestamp = DateTime.Now,
Message = "KS.EventServerRequest",
Name = item.Name,
Source = new EventSource { FQID = item.FQID, Name = item.Name, Description = "" },
MessageId = Guid.Empty,
CustomTag = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName.ToLower()
};
AnalyticsEvent eventData = new AnalyticsEvent { EventHeader = eventHeader };
EnvironmentManager.Instance.SendMessage(new Message(MessageId.Server.NewEventCommand, null, eventData), null, item.FQID);
}
catch (Exception ex) { }
and in the MyPluginBackgroundPlugin:
if (EnvironmentManager.Instance.EnvironmentType == EnvironmentType.Service)
{
MessageCommunicationManager.Start(EnvironmentManager.Instance.MasterSite.ServerId);
MsgCommHandler = MessageCommunicationManager.Get(EnvironmentManager.Instance.MasterSite.ServerId);
EventServerResponder = MsgCommHandler.RegisterCommunicationFilter(RefreshConfigurationReceiver, new CommunicationIdFilter(RefreshConfigurationsResponse));
EventServerSender = MsgCommHandler.RegisterCommunicationFilter(EventServerMessageReceiver, new CommunicationIdFilter(EventServerMessage));
}
again, i put a break points on the EventServerMessageReceiver and RefreshConfigurationReceiver and attached to debugger to eventserver process, and still got no hit after SendMessage.
am i missing something? am i doing something wrong?
As you can see on row 19 of SC code, you are sending an Event (MessageId.Server.NewEventCommand), so in ES you just need
PluginEventReceiverInstance = EnvironmentManager.Instance.RegisterReceiver(PluginEventReceiver, new MessageIdFilter(MessageId.Server.NewEventIndication));
where PluginEventReceiver method will be called by Message