activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtsafas <gtsa...@rblt.com>
Subject NMS: Error when trying to connect to a broker
Date Thu, 03 Sep 2009 17:56:22 GMT

I am trying to write a client connect to our activemq in c#.

When I try to compile I am recieving this error

No IConnectionFactory implementation found for connection URI:
activemq:tcp://192.168.1.13:61616

I am using the net 3.5 lib Apache.NMS 1.1.0.1642

I am calling this using

           IConnectionFactory factory = new
NMSConnectionFactory(connecturi);


Here is my code;

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

namespace WindowsAuthenticator
{
    class Authenticator
    {
        protected static ITextMessage message = null;
        
        static void Main(string[] args)
        {
            Authenticator authen = new Authenticator("192.168.42.30",
"61616");

        }

        Authenticator(string uri, string port)
        {

            Uri connecturi = new Uri("activemq:tcp://" + uri + ":" + port);
            IConnectionFactory factory = new
NMSConnectionFactory(connecturi);
            using (IConnection connection = factory.CreateConnection())
            using (ISession session = connection.CreateSession())
            {

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

                using (IMessageConsumer consumer =
session.CreateConsumer(destination))
                {
                    connection.Start();     // Must start the connection for
async messaging.
                    consumer.Listener += new MessageListener(OnMessage);
                }
            }
        }

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


Thanks ahead of time for the help.

-- 
View this message in context: http://www.nabble.com/NMS%3A-Error-when-trying-to-connect-to-a-broker-tp25281112p25281112.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message