Ejemplo n.º 1
0
        /// <summary>
        /// Connects the saga to the service bus
        /// </summary>
        /// <typeparam name="TSaga">The consumer type</typeparam>
        /// <param name="bus"></param>
        /// <param name="sagaRepository"></param>
        public static UnsubscribeAction SubscribeSaga <TSaga>(this IServiceBus bus, ISagaRepository <TSaga> sagaRepository)
            where TSaga : class, ISaga
        {
            if (_log.IsDebugEnabled)
            {
                _log.DebugFormat("Subscribing Saga: {0}", typeof(TSaga));
            }

            Guard.AgainstNull(sagaRepository, "sagaRepository", "A saga repository must be specified");

            var connector = new SagaConnector <TSaga>(sagaRepository);

            return(bus.Configure(x => connector.Connect(x)));
        }
Ejemplo n.º 2
0
 public SagaSubscriptionBuilder(ISagaRepository <TSaga> sagaRepository,
                                Func <UnsubscribeAction, ISubscriptionReference> referenceFactory)
 {
     _connector        = new SagaConnector <TSaga>(sagaRepository);
     _referenceFactory = referenceFactory;
 }
Ejemplo n.º 3
0
 public void A_consumer_with_consumes_all_interfaces_is_inspected()
 {
     _factory = new SagaConnector <SimpleSaga>(new InMemorySagaRepository <SimpleSaga>());
 }
Ejemplo n.º 4
0
 public void A_consumer_with_consumes_all_interfaces_is_inspected()
 {
     _factory = new SagaConnector <SimpleSaga>();
 }
Ejemplo n.º 5
0
 public void A_consumer_with_consumes_all_interfaces_is_inspected()
 {
     _factory = new SagaConnector<SimpleSaga>();
 }
Ejemplo n.º 6
0
 public SagaSubscriptionBuilder(ISagaRepository <TSaga> sagaRepository,
                                ReferenceFactory referenceFactory)
 {
     _connector        = new SagaConnector <TSaga>(sagaRepository);
     _referenceFactory = referenceFactory;
 }
Ejemplo n.º 7
0
		public void A_consumer_with_consumes_all_interfaces_is_inspected()
		{
			_factory = new SagaConnector<SimpleSaga>(new InMemorySagaRepository<SimpleSaga>());
		}