Exemple #1
0
        private static MamaDictionary buildDataDictionary(
			MamaTransport transport,
			MamaQueue defaultQueue,
			MamaSource dictionarySource)
        {
            bool[] gotDict = new bool[] { false };
            MamaDictionaryCallback dictionaryCallback = new DictionaryCallback(gotDict);
            lock (dictionaryCallback)
            {
                MamaSubscription subscription = new MamaSubscription ();

                MamaDictionary dictionary = new MamaDictionary();
                dictionary.create(
                    defaultQueue,
                    dictionaryCallback,
                    dictionarySource,
                    3,
                    10);

                Mama.start(myBridge);
                if (!gotDict[0])
                {
                    if (!Monitor.TryEnter(dictionaryCallback, 30000))
                    {
                        Console.Error.WriteLine("Timed out waiting for dictionary.");
                        Environment.Exit(0);
                    }
                    Monitor.Exit(dictionaryCallback);
                }
                return dictionary;
            }
        }
Exemple #2
0
 public void onComplete(MamaDictionary dictionary)
 {
     lock (this)
     {
         gotDict_[0] = true;
         Mama.stop(myBridge);
         Monitor.PulseAll(this);
     }
 }
Exemple #3
0
 public void onError(MamaDictionary dictionary, string message)
 {
     Console.Error.WriteLine("Error getting dictionary: {0}", message);
     Environment.Exit(1);
 }
Exemple #4
0
        public static void Main(string[] args)
        {
            try
            {
                options = new CommandLineProcessor(args);

                //Getting the log File name
                myLogFileName = options.getLogFileName();

                if (myLogFileName != null)
                {
                    myOutFile = new FileStream(myLogFileName, FileMode.OpenOrCreate);
                    myOut = new StreamWriter(myOutFile);
                    myOut.WriteLine("Date/Time"+ "," + "ChurnStats" +","
                        + "UpdateStats" + "," + "PeakMsgCount" + ","
                        + "RecapStats" + "," + "BookGapStats" + ","
                        +"freeMemory" +"," +"Memory Used");
                }
                else
                {
                    myOut = Console.Out;
                }

                // Initialize MAMA
                bridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                if (options.hasLogLevel())
                {
                    myLogLevel = options.getLogLevel();
                    Mama.enableLogging(myLogLevel);
                }

                transport = new MamaTransport();
                transport.create(options.getTransport(), bridge);

                defaultQueue = Mama.getDefaultEventQueue(bridge);

                //Get the Data dictionary.....
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = options.getDictSource();
                dictionarySource.transport = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaOrderBookFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    subscribeToBooks(symbol);
                }

                myChurnRate = options.getChurnRate();

                Thread.Sleep(10000);

                //Getting the TimerInterval from the cmd prompt
                myChurnInterval = options.getTimerInterval();

                //Churn Timer
                if (myChurnRate > 0)
                {
                    myChurnTimer = safeCreateTimer(new ChurnCallback(), myChurnInterval);
                }

                //Stats Timer
                myStatsTimer = safeCreateTimer(new StatsCallback(), 1.0);

                Console.WriteLine("Hit Enter or Ctrl-C to exit.");
                Mama.start(bridge);
                GC.KeepAlive(dictionary);
                Console.ReadLine();

                if (myOutFile != null)
                {
                    myOut.Close();
                }
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
Exemple #5
0
        static void Main(string[] args)
        {
            MamaTransport        transport    = null;
            MamaQueue            defaultQueue = null;
            MamaDictionary       dictionary   = null;
            CommandLineProcessor options      = new CommandLineProcessor(args);

            myQuietModeLevel = options.getQuietModeLevel();


            if (options.hasLogLevel())
            {
                myLogLevel = options.getLogLevel();
                Mama.enableLogging(myLogLevel);
            }

            myCacheFullBooks = options.cacheFullBooks();
            myPrintEntries   = options.getPrintEntries();
            mySnapshot       = options.getSnapshot();
            myPrecision      = options.getPrecision();
            try
            {
                //Initialize MAMA API
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport = new MamaTransport();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);
                myMamaSource = new MamaSource();
                //Get the Data dictionary.....
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = options.getDictSource();
                dictionarySource.transport       = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaOrderBookFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    MamdaSubscription      aSubscription = new MamdaSubscription();
                    MamdaOrderBookListener aBookListener;
                    if (myCacheFullBooks)
                    {
                        aBookListener = new MamdaOrderBookListener();
                    }
                    else
                    {
                        aBookListener = new MamdaOrderBookListener(null, new MamdaOrderBook());
                    }

                    BookTicker aTicker = new BookTicker();

                    aBookListener.addHandler(aTicker);
                    aSubscription.addMsgListener(aBookListener);
                    aSubscription.addStaleListener(aTicker);
                    aSubscription.addErrorListener(aTicker);

                    aSubscription.setType(mamaSubscriptionType.MAMA_SUBSC_TYPE_BOOK);
                    if (mySnapshot)
                    {
                        aSubscription.setServiceLevel(mamaServiceLevel.MAMA_SERVICE_LEVEL_SNAPSHOT, 0);
                    }
                    aSubscription.create(
                        transport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null);

                    mamdaSubscriptions.Add(aSubscription);
                }

                //Start dispatching on the default MAMA event queue
                Console.WriteLine("Hit Enter or Ctrl-C to exit.");
                Mama.start(myBridge);
                GC.KeepAlive(dictionary);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
Exemple #6
0
 public void onTimeout(MamaDictionary dictionary)
 {
     Console.Error.WriteLine("Timed out waiting for dictionary");
     Environment.Exit(1);
 }
Exemple #7
0
        public static void Main(string[] args)
        {
            MamaTransport        transport         = null;
            MamaTransport        dictTransport     = null;
            string               dictTransportName = null;
            MamaQueue            defaultQueue      = null;
            MamaDictionary       dictionary        = null;
            CommandLineProcessor options           = new CommandLineProcessor(args);

            if (options.hasLogLevel())
            {
                Mama.enableLogging(options.getLogLevel());
            }

            try
            {
                // Initialize MAMDA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport    = new MamaTransport();
                myMamaSource = new MamaSource();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);

                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = "WOMBAT";
                dictTransportName = options.getDictTransport();
                if (null != dictTransportName)
                {
                    dictTransport = new MamaTransport();
                    dictTransport.create(dictTransportName, myBridge);
                }
                else
                {
                    dictTransport = transport;
                }
                dictionarySource.transport = dictTransport;

                /*Get the data dictionary*/
                dictionary = buildDataDictionary(dictTransport, defaultQueue, dictionarySource);

                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    MamdaSubscription           aSubscription = new MamdaSubscription();
                    MamdaSecurityStatusListener aSecListener  = new MamdaSecurityStatusListener();
                    SecTicker aTicker = new SecTicker();

                    aSecListener.addHandler(aTicker);
                    aSubscription.addMsgListener(aSecListener);

                    aSubscription.create(transport,
                                         defaultQueue,
                                         options.getSource(),
                                         symbol,
                                         null);
                }

                Console.WriteLine("Hit Enter or Ctrl-C to exit.");
                Mama.start(myBridge);
                GC.KeepAlive(dictionary);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
        private void initializeMama()
        {
            mamaBridge = Mama.loadBridge(mamaMiddlewareName);

            Console.WriteLine(Mama.getVersion(mamaBridge));

            Mama.open();

            if (mamaHighWaterMark > 0 || mamaLowWaterMark > 0)
            {
                if (mamaHighWaterMark > 0)
                {
                    Mama.setDefaultQueueHighWatermark(mamaHighWaterMark);
                }

                if (mamaLowWaterMark > 0)
                {
                    try
                    {
                        Mama.setDefaultQueueLowWatermark(mamaLowWaterMark);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Could not set default queue low water mark MamaStatus: " + e);
                    }
                }
            }

            // create the transport
            mamaTransport = new MamaTransport();

            mamaTransport.setTransportCallback(this);

            // the default throttle rate is 500 msg/sec
            if (mamaThrottle != -1)
            {
                mamaTransport.setOutboundThrottle(MamaTransport.MamaThrottleInstance.MAMA_THROTTLE_DEFAULT, mamaThrottle);
            }

            // the default recap throttle rate is 250 msg/sec
            if (mamaRecapThrottle != -1)
            {
                mamaTransport.setOutboundThrottle(MamaTransport.MamaThrottleInstance.MAMA_THROTTLE_RECAP, mamaRecapThrottle);
            }

            mamaTransport.create(mamaTransportName, mamaBridge);

            // create default queue and, if required, queue group
            createQueues();

            mamaDictionarySource = new MamaSource();
            mamaDictionarySource.symbolNamespace = mamaDictionarySourceName;
            mamaDictionarySource.transport       = mamaTransport;

            // download dictionary
            mamaDictionary = new MamaDictionary();

            mamaDictionary.create(
                mamaDefaultQueue,
                this,
                mamaDictionarySource,
                3,
                10.0f);

            loadSymbolMap();

            Mama.start(mamaBridge);

            if (!dictionaryComplete)
            {
                throw new Exception("Can't create dictionary.");
            }
        }
Exemple #9
0
        static void Main(string[] args)
        {
            // Parse the command line options to override defaults
            String middlewareName     = "qpid";
            String transportName      = "sub";
            String sourceName         = "OM";
            String symbolName         = null;
            String dictionaryFile     = "/opt/openmama/data/dictionaries/data.dict";
            bool   requiresDictionary = true;
            bool   requiresInitial    = true;

            if (args.Length == 0)
            {
                usageAndExit();
            }

            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "-B":
                    requiresDictionary = false;
                    break;

                case "-d":
                    dictionaryFile = args[++i];
                    break;

                case "-I":
                    requiresInitial = false;
                    break;

                case "-m":
                    middlewareName = args[++i];
                    break;

                case "-s":
                    symbolName = args[++i];
                    break;

                case "-S":
                    sourceName = args[++i];
                    break;

                case "-t":
                    transportName = args[++i];
                    break;

                case "-v":
                    Mama.enableLogging(MamaLogLevel.MAMA_LOG_LEVEL_FINEST);
                    break;

                default:
                    usageAndExit();
                    break;
                }
            }

            // Symbol name is mandatory here, so error if it's null
            if (symbolName == null)
            {
                usageAndExit();
            }

            // Load the requested OpenMAMA middleware bridge (and default payload too)
            MamaBridge bridge = Mama.loadBridge(middlewareName);

            // Time to initialize OpenMAMA's underlying bridges with an "open"
            Mama.open();

            // Get default event queue from the bridge for testing
            MamaQueue queue = Mama.getDefaultEventQueue(bridge);

            // Set up the required transport on the specified bridge
            MamaTransport transport = new MamaTransport();

            transport.create(transportName, bridge);

            // Set up the data dictionary
            MamaDictionary dictionary = null;

            if (requiresDictionary)
            {
                dictionary = new MamaDictionary();
                dictionary.create(dictionaryFile);
            }

            // Set up the OpenMAMA source (symbol namespace)
            MamaSource source = new MamaSource();

            source.symbolNamespace = sourceName;
            source.transport       = transport;

            // Set up the event handlers for OpenMAMA
            SubscriptionEventHandler eventHandler = new SubscriptionEventHandler();

            eventHandler.mDictionary = dictionary;

            // Set up the OpenMAMA Subscription (interest in a topic)
            MamaSubscription subscription = new MamaSubscription();

            subscription.setRequiresInitial(requiresInitial);
            subscription.create(queue, eventHandler, source, symbolName);

            // Kick off OpenMAMA now (blocking call, non-blocking call also available)
            Mama.start(bridge);

            // Clean up connection on termination
            Mama.close();
        }
Exemple #10
0
        static void Main(string[] args)
        {
            MamaTransport        transport    = null;
            MamaQueue            defaultQueue = null;
            MamaDictionary       dictionary   = null;
            CommandLineProcessor options      = new CommandLineProcessor(args);

            if (options.hasLogLevel())
            {
                Mama.enableLogging(options.getLogLevel());
            }

            try
            {
                //Initialize MAMA API
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport = new MamaTransport();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);

                //Get the Data dictionary.....
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = "WOMBAT";
                dictionarySource.transport       = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaTradeFields.setDictionary(dictionary, null);

                mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count];
                int i = 0;
                foreach (string symbol in options.getSymbolList())
                {
                    mamdaSubscriptions[i] = new MamdaSubscription();
                    MamdaTradeListener aTradeListener = new MamdaTradeListener();
                    TradeTicker        aTicker        = new TradeTicker();

                    aTradeListener.addHandler(aTicker);
                    mamdaSubscriptions[i].addMsgListener(aTradeListener);
                    mamdaSubscriptions[i].addStaleListener(aTicker);
                    mamdaSubscriptions[i].addErrorListener(aTicker);

                    mamdaSubscriptions[i].create(
                        transport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null);
                    i++;
                }

                //Start dispatching on the default MAMA event queue
                Console.WriteLine("Hit Enter or Ctrl-C to exit.");
                Mama.start(myBridge);
                GC.KeepAlive(dictionary);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
        public static void Main(string[] args)
        {
            MamaTransport        transport    = null;
            MamaQueue            defaultQueue = null;
            MamaDictionary       dictionary   = null;
            CommandLineProcessor options      = new CommandLineProcessor(args);
            double throttleRate = options.getThrottleRate();


            if (options.hasLogLevel())
            {
                logLevel_ = options.getLogLevel();
                Mama.enableLogging(logLevel_);
            }

            if ((throttleRate > 100.0) || (throttleRate <= 0.0))
            {
                throttleRate = 100.0;
            }

            try
            {
                // Initialize MAMDA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();

                transport = new MamaTransport();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);
                //Get the Data dictionary.....
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = options.getDictSource();
                dictionarySource.transport       = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                //Initialise the dictionary and fields
                MamdaCommonFields.setDictionary(dictionary, null);
                MamdaQuoteFields.setDictionary(dictionary, null);
                MamdaTradeFields.setDictionary(dictionary, null);

                foreach (string symbol in options.getSymbolList())
                {
                    MamdaSubscription aSubscription = new MamdaSubscription();
                    aSubscription.setType(mamaSubscriptionType.MAMA_SUBSC_TYPE_GROUP);
                    aSubscription.create(
                        transport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null);

                    /* For each subscription a MamdaMultiParticipantManager is
                     * added as the message listener. The callbacks on the
                     * MamdaMultiPartHandler will be invokes as new group members
                     * become available.*/
                    MamdaMultiParticipantManager multiPartManager =
                        new MamdaMultiParticipantManager(symbol);
                    multiPartManager.addHandler(new MultiPartHandler());

                    aSubscription.addMsgListener(multiPartManager);

                    aSubscription.activate();

                    mamdaSubscriptions.Add(aSubscription);
                }

                Mama.start(myBridge);
                GC.KeepAlive(dictionary);
                Console.WriteLine("Press ENTER or Ctrl-C to quit...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
Exemple #12
0
        public void onError(MamaDictionary dictionary, string message)
        {
            Console.WriteLine("Dictionary error:" + message);

            Mama.stop(mamaBridge);
        }
Exemple #13
0
        /// <summary>
        /// Dictionary callbacks
        /// </summary>
        /////////////////////////////////////////////////////////////////////////////////////////////////
        public void onTimeout(MamaDictionary dictionary)
        {
            Console.WriteLine("Dictionary timeout.");

            Mama.stop(mamaBridge);
        }
Exemple #14
0
 public void onError(MamaDictionary dictionary, string message)
 {
     Console.Error.WriteLine("Error getting dictionary: {0}", message);
     Environment.Exit(1);
 }
        public static void Main(string[] args)
        {
            MamaTransport        transport    = null;
            MamaQueue            defaultQueue = null;
            MamaDictionary       dictionary   = null;
            CommandLineProcessor options      = new CommandLineProcessor(args);

            myQuietModeLevel = options.getQuietModeLevel();

            if (options.hasLogLevel())
            {
                myLogLevel = options.getLogLevel();
                Mama.enableLogging(myLogLevel);
            }

            try
            {
                // Initialize MAMDA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();
                transport = new MamaTransport();
                transport.create(options.getTransport(), myBridge);
                defaultQueue = Mama.getDefaultEventQueue(myBridge);

                /*Get the data dictionary*/
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = options.getDictSource();
                dictionarySource.transport       = transport;
                dictionary = buildDataDictionary(transport, defaultQueue, dictionarySource);

                MamdaQuoteFields.setDictionary(dictionary, null);
                MamdaTradeFields.setDictionary(dictionary, null);
                MamdaSecurityStatusFields.setDictionary(dictionary, null);

                mamdaSubscriptions = new MamdaSubscription [options.getSymbolList().Count];
                int i = 0;
                foreach (string symbol in options.getSymbolList())
                {
                    mamdaSubscriptions[i] = new MamdaSubscription();

                    MamdaTradeListener          aTradeListener          = new MamdaTradeListener();
                    MamdaQuoteListener          aQuoteListener          = new MamdaQuoteListener();
                    MamdaSecurityStatusListener aSecurityStatusListener = new MamdaSecurityStatusListener();
                    ComboTicker aTicker = new ComboTicker();

                    aTradeListener.addHandler(aTicker);
                    aQuoteListener.addHandler(aTicker);
                    aSecurityStatusListener.addHandler(aTicker);
                    mamdaSubscriptions[i].addMsgListener(aTradeListener);
                    mamdaSubscriptions[i].addMsgListener(aQuoteListener);
                    mamdaSubscriptions[i].addStaleListener(aTicker);
                    mamdaSubscriptions[i].addErrorListener(aTicker);

                    mamdaSubscriptions[i].create(transport,
                                                 defaultQueue,
                                                 options.getSource(),
                                                 symbol,
                                                 null /*Closure*/);

                    i++;
                }

                Console.WriteLine("Hit Enter or Ctrl-C to exit.");
                Mama.start(myBridge);
                GC.KeepAlive(dictionary);
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
Exemple #16
0
 public void onTimeout(MamaDictionary dictionary)
 {
     Console.Error.WriteLine("Timed out waiting for dictionary");
     Environment.Exit(1);
 }
        public static void Main(string[] args)
        {
            MamaTransport        baseTransport     = null;
            MamaTransport        optionTransport   = null;
            MamaTransport        dictTransport     = null;
            string               dictTransportName = null;
            MamaQueue            defaultQueue      = null;
            MamaDictionary       dictionary        = null;
            CommandLineProcessor options           = new CommandLineProcessor(args);


            if (options.hasLogLevel())
            {
                logLevel_ = options.getLogLevel();
                Mama.enableLogging(logLevel_);
            }

            try
            {
                // Initialize MAMA
                myBridge = new MamaBridge(options.getMiddleware());
                Mama.open();

                // Initialize transports.  We're assuming that options and
                // underlyings might be on different transports.  Note:
                // some companies might use multiple transports for
                // underlyings (e.g., CTA and NASDAQ), which case it would
                // be necessary to create three transports here and be
                // sure to pass the correct transport later.
                baseTransport = new MamaTransport();
                baseTransport.create(options.getTransport(), myBridge);
                optionTransport = baseTransport;
                defaultQueue    = Mama.getDefaultEventQueue(myBridge);

                // Fetch and initialize the data dictionary
                MamaSource dictionarySource = new MamaSource();
                dictionarySource.symbolNamespace = options.getDictSource();
                dictTransportName = options.getDictTransport();
                if (null != dictTransportName)
                {
                    dictTransport = new MamaTransport();
                    dictTransport.create(dictTransportName, myBridge);
                }
                else
                {
                    dictTransport = baseTransport;
                }
                dictionarySource.transport = dictTransport;
                dictionary = buildDataDictionary(dictTransport, defaultQueue, dictionarySource);
                MamdaQuoteFields.setDictionary(dictionary, null);
                MamdaTradeFields.setDictionary(dictionary, null);
                MamdaFundamentalFields.setDictionary(dictionary, null);
                MamdaOptionFields.setDictionary(dictionary, null);

                // Create listeners for each chain.  Two subscriptions are
                // necessary.
                foreach (string symbol in options.getSymbolList())
                {
                    // Create chain and listener objects.
                    MamdaTradeListener aBaseTradeListener = new MamdaTradeListener();
                    MamdaQuoteListener aBaseQuoteListener = new MamdaQuoteListener();
                    MamdaOptionChain   anOptionChain      = new MamdaOptionChain(symbol);
                    anOptionChain.setUnderlyingQuoteListener(aBaseQuoteListener);
                    anOptionChain.setUnderlyingTradeListener(aBaseTradeListener);
                    MamdaOptionChainListener anOptionListener =
                        new MamdaOptionChainListener(anOptionChain);

                    // Create our handlers (the UnderlyingTicker and
                    // OptionChainDisplay could be a single class).
                    UnderlyingTicker aBaseTicker =
                        new UnderlyingTicker(anOptionChain, true);
                    OptionChainDisplay aDisplay =
                        new OptionChainDisplay(anOptionChain);

                    // Create subscriptions for underlying and option chain:
                    MamdaSubscription aBaseSubscription    = new MamdaSubscription();
                    MamdaSubscription anOptionSubscription =
                        new MamdaSubscription();

                    // Register for underlying quote and trade events.
                    aBaseTradeListener.addHandler(aBaseTicker);
                    aBaseQuoteListener.addHandler(aBaseTicker);
                    aBaseSubscription.addMsgListener(aBaseTradeListener);
                    aBaseSubscription.addMsgListener(aBaseQuoteListener);

                    aBaseSubscription.create(
                        baseTransport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null);
                    mamdaSubscriptions.Add(aBaseSubscription);
                    // Register for underlying option events.
                    anOptionListener.addHandler(aDisplay);

                    // We set the timeout to 1 for this example because we
                    // currently use the timeout feature to determine when
                    // to say that we have received all of the initials.
                    // There will be a separate time interval for this in
                    // the future.
                    anOptionSubscription.setTimeout(1);
                    anOptionSubscription.addMsgListener(anOptionListener);
                    anOptionSubscription.addStaleListener(aDisplay);
                    anOptionSubscription.addErrorListener(aDisplay);
                    anOptionSubscription.setType(mamaSubscriptionType.MAMA_SUBSC_TYPE_GROUP);
                    anOptionSubscription.create(
                        optionTransport,
                        defaultQueue,
                        options.getSource(),
                        symbol,
                        null);
                    optionSubscriptions.Add(anOptionSubscription);
                }

                //Start dispatching on the default event queue
                Mama.start(myBridge);
                GC.KeepAlive(dictionary);

                Console.WriteLine("Press ENTER or Ctrl-C to quit...");
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }