Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.Title = "Subscriber.Alpha";
            ISubscribe subscriber;

            switch (Config.Examples.CURRENT_EXAMPLE)
            {
            case Config.Examples.HELLO_WORLD:
                subscriber = new HelloWorld();
                subscriber.Start(args);
                break;

            case Config.Examples.WORK_QUEUES:
                Thread.Sleep(500);
                subscriber = new WorkQueues();
                subscriber.Start(args);
                break;

            case Config.Examples.PUBLISH_SUBSCRIBE:
                Thread.Sleep(500);
                subscriber = new PublishSubscribe();
                subscriber.Start(args);
                break;

            case Config.Examples.ROUTING:
                Thread.Sleep(500);
                subscriber = new Routing();
                subscriber.Start(new string[] { Config.Severity.INFO });
                break;

            case Config.Examples.TOPIC:
                Console.Title = Config.Topics.ALPHA_CONSOLE_TITLE;
                subscriber    = new Topics();
                subscriber.Start(new string[] { Config.Topics.LCODE_ROUTING_KEY });
                break;

            case Config.Examples.RPC:
                subscriber = new Rpc();
                subscriber.Start(args);
                break;
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.Title = "Publisher";
            IPublish publisher;

            switch (Config.Examples.CURRENT_EXAMPLE)
            {
            case Config.Examples.HELLO_WORLD:
                publisher = new HelloWorld();
                publisher.Start(args, new Messages().RandomDefaultStartMessages());
                break;

            case Config.Examples.WORK_QUEUES:
                Thread.Sleep(500);
                publisher = new WorkQueues();
                publisher.Start(args, new Messages().RandomDefaultStartMessages());
                break;

            case Config.Examples.PUBLISH_SUBSCRIBE:
                Thread.Sleep(500);
                publisher = new PublishSubscribe();
                publisher.Start(args, new Messages().RandomDefaultStartMessages());
                break;

            case Config.Examples.ROUTING:
                Thread.Sleep(500);
                publisher = new Routing();
                publisher.Start(args, new Messages().RandomDefaultStartMessages());
                break;

            case Config.Examples.TOPIC:
                publisher = new Topics();
                publisher.Start(args, new Messages().RandomDefaultStartMessages(true));
                break;

            case Config.Examples.RPC:
                publisher = new Rpc();
                publisher.Start(args, new Messages().RandomDefaultStartMessages());
                break;
            }
        }