public EventHubMessageSender(IMessageExchnage <TMsg> messageExchnage, IConverter <TMsg, object> dataConverter, Dictionary <string, object> settings) { _messageExchange = messageExchnage; _dataConverter = dataConverter; _eventHubConfig = new Dictionary <string, string>(); _settings = settings; }
/// <summary> /// All the following fields are mandatory; the data type of all the fields are string type /// settings.ServiceBusNameSpace, settings.EventHubName, settings.EventHubConnectionString /// </summary> /// <param name="settings"></param> public void Initialize(Dictionary <string, object> settings) { string[] fieldNames = new string[] { "EventHubConfigFile", "MessageExchange", "TagToEventDataConverter" }; //validates missing fields and throws ValidationException in case of errors. Let us not catch it here so as to avoid //passing it through multiple layers FieldValidator.CheckMissingFields(settings, fieldNames); string eventHubConfigFile = settings.GetValueOrNull("EventHubConfigFile") as string; _eventHubConfig = ConfigUtility.ReadConfig <Dictionary <string, string> >(eventHubConfigFile); _messageExchange = settings.GetValueOrNull("MessageExchange") as IMessageExchnage <TMsg>; _dataConverter = settings.GetValueOrNull("TagToEventDataConverter") as IConverter <TMsg, object>; }
public EventHubMessageSender(IMessageExchnage <TMsg> messageExchnage) { _messageExchange = messageExchnage; _eventHubConfig = new Dictionary <string, string>(); }