public static DataEventAction <T, TData> RetryLater <T, TData>(this DataEventAction <T, TData> eventAction) where T : SagaStateMachine <T>, ISaga where TData : class { eventAction.Call((saga, message) => ContextStorage.MessageContext <TData>().RetryLater()); return(eventAction); }
static void RewriteResponseAddress(Uri responseAddress) { var context = ContextStorage.MessageContext <Distributed <TMessage> >() as ConsumeContext <Distributed <TMessage> >; if (context != null) { context.SetResponseAddress(responseAddress); } }
public void Execute(Composer composer, TInstance instance, TData value) { composer.Execute(() => { IConsumeContext <TData> context = ContextStorage.MessageContext <TData>(); context.RetryLater(); }); }
public void Execute(Composer composer, TInstance instance, TData value) { composer.Execute(() => { IConsumeContext <TData> context = ContextStorage.MessageContext <TData>(); TMessage message = _messageFactory(instance, context); instance.Bus.PublishRequest(message, configurator => _configurator(instance, context, configurator)); }); }
public void Execute(Composer composer, TInstance instance, TData value) { composer.Execute(() => { IConsumeContext <TData> context = ContextStorage.MessageContext <TData>(); TMessage message = _messageFactory(instance, context); context.Respond(message, _contextCallback); }); }
public static EventActivityBinder <TInstance, TData> Publish <TInstance, TData, TMessage>( this EventActivityBinder <TInstance, TData> source, Func <TInstance, IConsumeContext <TData>, TData, TMessage> messageFactory) where TInstance : class, SagaStateMachineInstance where TData : class where TMessage : class { Func <TInstance, TData, TMessage> factory = (i, d) => messageFactory(i, ContextStorage.MessageContext <TData>(), d); return(source.Add(new PublishActivity <TInstance, TData, TMessage>(factory, x => { }))); }
public void Consume(IGetMessageTraceList message) { IConsumeContext <IGetMessageTraceList> context = ContextStorage.MessageContext <IGetMessageTraceList>(); Uri responseAddress = context.ResponseAddress; if (responseAddress == null) { return; } int count = message.Count; IEndpoint responseEndpoint = context.Bus.GetEndpoint(responseAddress); _fiber.Add(() => SendLastTraceMessagesTo(responseEndpoint, count)); }
public static IConsumeContext <T> MessageContext <T>(this IServiceBus bus) where T : class { return(ContextStorage.MessageContext <T>()); }
public static IConsumeContext <T> MessageContext <T>(this Consumes <T> .All instance) where T : class { return(ContextStorage.MessageContext <T>()); }