Beispiel #1
0
        public static void Main(string[] args)
        {
            IApplicationContext springContainer = ContextRegistry.GetContext();

            IStandardStreamingEventBus streamingEventBus = springContainer.GetObject(
                typeof(IStandardStreamingEventBus).FullName)
                                                           as IStandardStreamingEventBus;


            IList <ModernMajorGeneralMessage> streamMessages = new List <ModernMajorGeneralMessage>();

            streamMessages.Add(new ModernMajorGeneralMessage("I am "));
            streamMessages.Add(new ModernMajorGeneralMessage("the very "));
            streamMessages.Add(new ModernMajorGeneralMessage("model of "));
            streamMessages.Add(new ModernMajorGeneralMessage("a Modern "));
            streamMessages.Add(new ModernMajorGeneralMessage("Major-General "));
            streamMessages.Add(new ModernMajorGeneralMessage("I've information "));
            streamMessages.Add(new ModernMajorGeneralMessage("vegetable, animal, "));
            streamMessages.Add(new ModernMajorGeneralMessage("and mineral, "));
            streamMessages.Add(new ModernMajorGeneralMessage("I know the kings of England, "));
            streamMessages.Add(new ModernMajorGeneralMessage("and I quote the fights historical, "));
            streamMessages.Add(new ModernMajorGeneralMessage("From Marathon to Waterloo, "));
            streamMessages.Add(new ModernMajorGeneralMessage("in order categorical; "));

            streamingEventBus.PublishChunkedSequence(streamMessages);

            Environment.Exit(0);
        }
Beispiel #2
0
 public DefaultEventStream(IStandardStreamingEventBus eventBus, string topic)
 {
     _log = LogManager.GetLogger(this.GetType());
     _eventBus = eventBus;
     _topic = topic;
     _queuedEvents = new Queue<EventStreamQueueItem>();
     _sequenceId = Guid.NewGuid();
     _position = 0;
 }
Beispiel #3
0
 public DefaultEventStream(IStandardStreamingEventBus eventBus, string topic)
 {
     _log          = LogManager.GetLogger(this.GetType());
     _eventBus     = eventBus;
     _topic        = topic;
     _queuedEvents = new Queue <EventStreamQueueItem>();
     _sequenceId   = Guid.NewGuid();
     _position     = 0;
 }
        public static void Main(string[] args)
        {
            IApplicationContext springContainer = ContextRegistry.GetContext();

            IStandardStreamingEventBus streamingEventBus = springContainer.GetObject(
                typeof(IStandardStreamingEventBus).FullName)
                                                           as IStandardStreamingEventBus;
            IStreamingReaderHandler <ModernMajorGeneralMessage> handler = new ReaderHandler();

            streamingEventBus.SubscribeToReader(handler);

            Console.WriteLine("If all events have been received, hit the Enter Key to exit the program.");
            Console.Read();
            Environment.Exit(0);
        }