activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtsafas <gtsa...@rblt.com>
Subject Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://192.168.1.13:61616
Date Thu, 03 Sep 2009 19:47:40 GMT

Here is my exact code

using System;
using System.Collections.Generic;
using System.Text;
using Apache.NMS.ActiveMQ;
using Apache.NMS;
using Apache.NMS.Util;
using System.Threading;

namespace WindowsAuthenticator
{
    class Authenticator
    {
        protected static ITextMessage message = null;
        
        static void Main(string[] args)
        {
            //if (args.Length < 2)
            //{
            //    Console.WriteLine("Please specify the broker URL and
Port");
            //    Environment.Exit(0);
            //}

            //Authenticator authen = new Authenticator(args[0], args[1]);
            Authenticator authen = new Authenticator("192.168.42.30",
"61616");

           

        }

        Authenticator(string uri, string port)
        {
            //brokerURI = uri;
            //this.port = port;
            try
            {
                Uri connecturi = new Uri("tcp://" + uri + ":" + port +
"?wireFormat=openwire");
                Apache.NMS.ActiveMQ.ConnectionFactory factory = new
ConnectionFactory(connecturi);
                IConnection connection = factory.CreateConnection();
                ISession session = connection.CreateSession();

                IDestination destination =
SessionUtil.GetDestination(session, "topic://Topic.MD.Realtime.Stats");
                Console.WriteLine("Using destination: " + destination);

                IMessageConsumer consumer =
session.CreateConsumer(destination);
                connection.Start();
                consumer.Listener += new MessageListener(OnMessage);

                Thread.Sleep(100000);
            }
            catch (Apache.NMS.NMSConnectionException e)
            {
                Console.WriteLine(e.Message);
            }


        }

        protected static void OnMessage(IMessage receivedMsg)
        {
            message = receivedMsg as ITextMessage;
            Console.WriteLine(message.Text);
        }
    }
}

-- 
View this message in context: http://www.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI%3A-activemq%3Atcp%3A--192.168.1.13%3A61616-tp25280396p25282892.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message