protected TransactionModuleTestBase(IPublishMessages publisher)
        {
            this.publisher = publisher;

            bootstrapper = new TestingBootstrapper(publisher);
            browser = new Browser(bootstrapper);
        }
Exemple #2
0
 public AsynchronousDispatcherWireup(Wireup wireup, IPublishMessages publisher)
     : base(wireup)
 {
     this.PublishTo(publisher ?? new NullDispatcher());
     this.Container.Register <IDispatchCommits>(c => new AsynchronousDispatcher(
                                                    c.Resolve <IPublishMessages>(), c.Resolve <IPersistStreams>()));
 }
 public SynchronousDispatcherWireup(Wireup wireup, IPublishMessages publisher)
     : base(wireup)
 {
     this.PublishTo(publisher ?? new NullDispatcher());
     this.Container.Register<IDispatchCommits>(c => new SynchronousDispatcher(
         c.Resolve<IPublishMessages>(), c.Resolve<IPersistStreams>()));
 }
 protected override void PublishMessages(IPublishMessages publisher, int count, Type eventType)
 {
     for (var i = 0; i < count; i++)
     {
         PublishMessage(publisher, eventType, i);
     }
 }
Exemple #5
0
        public SynchronousDispatcher(IPublishMessages bus, IPersistStreams persistence)
        {
            this.bus         = bus;
            this.persistence = persistence;

            this.Start();
        }
        public AsynchronousDispatcher(IPublishMessages bus, IPersistStreams persistence)
        {
            this.bus = bus;
            this.persistence = persistence;

            this.Start();
        }
Exemple #7
0
 protected override void PublishMessages(IPublishMessages publisher, int count, Type eventType)
 {
     for (var i = 0; i < count; i++)
     {
         PublishMessage(publisher, eventType, i);
     }
 }
Exemple #8
0
 public Bus(ISerializeMessages messageSerializer, ITransportMessages messageTransport, IRouteMessageToEndpoint messageRouter, IPublishMessages messagePublisher, IProcessMessages messageProcessor)
 {
     this.messageSerializer = messageSerializer;
     this.messageTransport = messageTransport;
     this.messageRouter = messageRouter;
     this.messagePublisher = messagePublisher;
     this.messageProcessor = messageProcessor;
 }
 private IStoreEvents GetInitializedEventStore(IPublishMessages bus)
 {
     return Wireup.Init()
         //.UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new ByteStreamDocumentSerializer(BuildSerializer()))
         .UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new NullDocumentSerializer())
         .UsingSynchronousDispatcher(bus)
         .Build();
 }
Exemple #10
0
        public RegisterWrappers(ISendMessages sender, IPublishMessages publisher, IDeferMessages defer, ScenarioContext sc, ReadOnlySettings settings)
        {
            var container = settings.Get <IConfigureComponents>("SC.ConfigureComponent");

            container.RegisterSingleton(typeof(ISendMessages), new SendMessagesWrapper(sender, sc));
            container.RegisterSingleton(typeof(IPublishMessages), new PublishMessagesWrapper(publisher, sc));
            container.RegisterSingleton(typeof(IDeferMessages), new DeferMessagesWrapper(defer, sc));
        }
Exemple #11
0
 public ClientProxy(string showId, string clientConnectionId,
                    IEnumerable <string> seatsReservedAsInitiallyViewedByTheClient, IPublishMessages messagePublisher)
 {
     _showId             = showId;
     _clientConnectionId = clientConnectionId;
     _messagePublisher   = messagePublisher;
     _seatsReservedAsViewedByTheClient = seatsReservedAsInitiallyViewedByTheClient?.ToList();
 }
Exemple #12
0
 private IStoreEvents GetInitializedEventStore(IPublishMessages bus)
 {
     return(Wireup.Init()
            //.UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new ByteStreamDocumentSerializer(BuildSerializer()))
            .UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new NullDocumentSerializer())
            .UsingSynchronousDispatcher(bus)
            .Build());
 }
        public AsynchronousDispatcher(
			IPublishMessages bus, IPersistStreams persistence, Action<Commit, Exception> handleException)
        {
            this.bus = bus;
            this.persistence = persistence;
            this.handleException = handleException ?? ((c, e) => { });

            this.Start();
        }
 protected override void PublishMessages(IPublishMessages publisher, int count, Type eventType)
 {
     using (var tx = new TransactionScope())
     {
         for (var i = 0; i < count; i++)
         {
             PublishMessage(publisher, eventType, i);
         }
         tx.Complete();
     }
 }
 protected override void PublishMessages(IPublishMessages publisher, int count, Type eventType)
 {
     using (var tx = new TransactionScope())
     {
         for (var i = 0; i < count; i++)
         {
             PublishMessage(publisher, eventType, i);
         }
         tx.Complete();
     }
 }
 public ShowsController(IProvideAuditoriumSeating auditoriumSeating,
                        IProvideReservedSeats reservedSeats, ISuggestSeats seatSuggestionsProvider,
                        IProvidePrices pricingProvider, IHubContext <ReservationsHub> hubContext, IPublishMessages publisher,
                        IHostClientProxies clientProxyPool)
 {
     _auditoriumSeating       = auditoriumSeating;
     _reservedSeats           = reservedSeats;
     _seatSuggestionsProvider = seatSuggestionsProvider;
     _pricingProvider         = pricingProvider;
     _hubContext      = hubContext;
     _publisher       = publisher;
     _clientProxyPool = clientProxyPool;
 }
Exemple #17
0
        private async Task PublishNewReservedSeats(IEnumerable <string> newlyAddedReservations)
        {
            var topic = TopicBuilder.BuildTopicFor(_showId);

            if (_messagePublisher == null)
            {
                // TEMP: should not happen at runtime!!!!
                _messagePublisher = _publishersFactory();
            }

            // Should we catch here?
            // var publisher = _publishersFactory(); // get a SignalR publisher
            await _messagePublisher.SendNewlyReservedSeatsAsync(topic, _clientConnectionId,
                                                                newlyAddedReservations.ToArray());
        }
        private IStoreEvents GetInitializedEventStore(IPublishMessages bus)
        {
            return(Wireup.Init()
                   .UsingSqlPersistence(AppConfig.SqlDBConnectionStringName)
                   //.InitializeStorageEngine()
                   .UsingJsonSerialization()
                   .Compress()
                   .UsingSynchronousDispatcher(bus)
                   .Build());

            //         .UsingSqlPersistence("EventStore")
            //	.InitializeStorageEngine()
            //	.UsingJsonSerialization()
            //		.Compress()
            //		.EncryptWith(EncryptionKey)
            //.HookIntoPipelineUsing(new[] { new AuthorizationPipelineHook() })
            //.UsingAsynchronousDispatcher()
            //	.PublishTo(new DelegateMessagePublisher(DispatchCommit))
            //.Build();
        }
 public StopLossProcessManager(IPublishMessages publisher)
 {
     _publisher = publisher;
 }
 protected void PublishMessage(IPublishMessages publisher, Type eventType, int i)
 {
     publisher.Publish(GenerateTransportMessage(i, eventType.FullName), new[] { eventType });
 }
 public TestingBootstrapper(IPublishMessages publisher)
 {
     this.publisher = publisher;
 }
 protected override void SetupClient()
 {
     this.clientChannel = this.channelFactory.CreatePublisher();
     this.clientChannel.Connect(endpoint);
 }
 public static SynchronousDispatcherWireup UsingSynchronousDispatcher(this Wireup wireup, IPublishMessages publisher)
 {
     return new SynchronousDispatcherWireup(wireup, publisher);
 }
 public when_publishing_topic_message_to_rabbitmq()
 {
     bus = new FakeBus();
     message = new TopicTestMessage();
     publisher = new RabbitMQ.Publisher(bus);
 }
 public MsmqReceiver(Configure configure, CriticalError criticalError, IPublishMessages publisher)
 {
     this.configure = configure;
     this.criticalError = criticalError;
     this.publisher = publisher;
 }
Exemple #26
0
 public static AsynchronousDispatcherWireup UsingAsynchronousDispatcher(this Wireup wireup, IPublishMessages publisher)
 {
     return(new AsynchronousDispatcherWireup(wireup, publisher));
 }
 public DispatchToTransportStep(ISendMessages sender, IPublishMessages publisher)
 {
     this.publisher = publisher;
     this.sender    = sender;
 }
 public when_publishing_a_null_message_to_rabbitmq()
 {
     bus = new FakeBus();
     message = null;
     publisher = new global::Workflow.RabbitMQ.Publisher(bus);
 }
Exemple #29
0
        //public ClientProxyPool(InstantiatePublishers publishersFactory, ShowReservationsWatcherPool reservationsWatcherPool)
        //{
        //    _publishersFactory = publishersFactory;
        //    _reservationsWatcherPool = reservationsWatcherPool;
        //}


        public ClientProxyPool(IPublishMessages messagePublisher, IOwnReservationsWatchers reservationsWatcherPool)
        {
            _messagePublisher        = messagePublisher;
            _reservationsWatcherPool = reservationsWatcherPool;
        }
 public when_publishing_a_message_and_the_underlying_bus_fails()
 {
     bus = new FailingBus();
     message = new TestMessage();
     publisher = new global::Workflow.RabbitMQ.Publisher(bus, new TestingRetryStrategy());
 }
Exemple #31
0
 public PublishMessagesWrapper(IPublishMessages wrappedPublisher, ScenarioContext context)
 {
     this.wrappedPublisher = wrappedPublisher;
     sessionId             = context.SessionId;
 }
 public PublisherFactory(IPublishMessages publisher)
 {
     _publisher = publisher;
 }
 public SynchronousDispatcherWireup PublishTo(IPublishMessages instance)
 {
     this.Container.Register(instance);
     return this;
 }
 protected void PublishMessage(IPublishMessages publisher, Type eventType, int i)
 {
     publisher.Publish(GenerateTransportMessage(i, eventType.FullName), new[] { eventType });
 }
 public DispatchToTransportStep(ISendMessages sender, IPublishMessages publisher)
 {
     this.publisher = publisher;
     this.sender = sender;
 }
Exemple #36
0
 protected abstract void PublishMessages(IPublishMessages publisher, int count, Type eventType);
Exemple #37
0
 public MsmqReceiver(Configure configure, CriticalError criticalError, IPublishMessages publisher)
 {
     this.configure     = configure;
     this.criticalError = criticalError;
     this.publisher     = publisher;
 }
 protected abstract void PublishMessages(IPublishMessages publisher, int count, Type eventType);
Exemple #39
0
 public AsynchronousDispatcherWireup PublishTo(IPublishMessages instance)
 {
     this.Container.Register(instance);
     return(this);
 }