public void Send <T>(Action <IMessageSendTopologyConfigurator <T> > configureTopology) where T : class { IMessageSendTopologyConfigurator <T> configurator = _configuration.Topology.Send.GetMessageTopology <T>(); configureTopology?.Invoke(configurator); }
public void MessageTopologyCreated <T>(IMessageSendTopologyConfigurator <T> configuration) where T : class { IMessageSendTopologyConfigurator <T> specification = _sendTopology.GetMessageTopology <T>(); configuration.AddDelegate(specification); }
public void MessageTopologyCreated <T>(IMessageSendTopologyConfigurator <T> configuration) where T : class { All(observer => { observer.MessageTopologyCreated(configuration); return(true); }); }
public static void UseRoutingKeyFormatter <T>(this IMessageSendTopologyConfigurator <T> configurator, IMessageRoutingKeyFormatter <T> formatter) where T : class { configurator.UpdateConvention <IRoutingKeyMessageSendTopologyConvention <T> >( update => { update.SetFormatter(formatter); return(update); }); }
void ApplyConventionsToMessageTopology <T>(IMessageSendTopologyConfigurator <T> messageTopology) where T : class { IMessageSendTopologyConvention[] conventions; lock (_lock) conventions = _conventions.ToArray(); foreach (var convention in conventions) { if (convention.TryGetMessageSendTopologyConvention(out IMessageSendTopologyConvention <T> messageSendTopologyConvention)) { messageTopology.TryAddConvention(messageSendTopologyConvention); } } }
/// <summary> /// Specify for the message type that the delegate be used for setting the CorrelationId /// property of the message envelope. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="configurator"></param> /// <param name="correlationIdSelector"></param> public static void UseCorrelationId <T>(this IMessageSendTopologyConfigurator <T> configurator, Func <T, Guid?> correlationIdSelector) where T : class { configurator.AddOrUpdateConvention <ICorrelationIdMessageSendTopologyConvention <T> >( () => { var convention = new CorrelationIdMessageSendTopologyConvention <T>(); convention.SetCorrelationId(new NullableDelegateMessageCorrelationId <T>(correlationIdSelector)); return(convention); }, update => { update.SetCorrelationId(new NullableDelegateMessageCorrelationId <T>(correlationIdSelector)); return(update); }); }
/// <summary> /// Use the delegate to format the routing key, using Empty if the string is null upon return /// </summary> /// <typeparam name="T"></typeparam> /// <param name="configurator"></param> /// <param name="formatter"></param> public static void UseRoutingKeyFormatter <T>(this IMessageSendTopologyConfigurator <T> configurator, Func <SendContext <T>, string> formatter) where T : class { configurator.UseRoutingKeyFormatter(new DelegateRoutingKeyFormatter <T>(formatter)); }
IAmazonSqsMessageSendTopologyConfigurator <T> IAmazonSqsSendTopology.GetMessageTopology <T>() { IMessageSendTopologyConfigurator <T> configurator = base.GetMessageTopology <T>(); return(configurator as IAmazonSqsMessageSendTopologyConfigurator <T>); }
protected void OnMessageTopologyCreated <T>(IMessageSendTopologyConfigurator <T> messageTopology) where T : class { _observers.MessageTopologyCreated(messageTopology); }
void ISendTopologyConfigurator.AddMessageSendTopology <T>(IMessageSendTopology <T> topology) { IMessageSendTopologyConfigurator <T> messageConfiguration = GetMessageTopology <T>(); messageConfiguration.Add(topology); }
void ISendTopologyConfigurationObserver.MessageTopologyCreated <T>(IMessageSendTopologyConfigurator <T> messageTopology) { ApplyConventionsToMessageTopology(messageTopology); }
IRabbitMqMessageSendTopologyConfigurator <T> IRabbitMqSendTopology.GetMessageTopology <T>() { IMessageSendTopologyConfigurator <T> configurator = base.GetMessageTopology <T>(); return(configurator as IRabbitMqMessageSendTopologyConfigurator <T>); }