activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Pileggi <chocolateaz...@hotmail.com>
Subject Re: No IConnectionFactory implementation found for connection URI: activemq:tcp://localhost:61616
Date Sat, 12 Apr 2014 22:10:31 GMT
This work for me:

Download from here: 

http://ftp.unicamp.br/pub/apache/activemq/apache-nms/1.6.0/Apache.NMS.ActiveMQ-1.6.2-bin.zip
http://ftp.unicamp.br/pub/apache/activemq/5.9.1/apache-activemq-5.9.1-bin.zip

Put this on import clause:

using Apache.NMS.ActiveMQ;
using Apache.NMS.Util;
using Apache.NMS;

And connect like this:

        private void EnviarObjeto(string fila, object objeto, string
identificador)
        {
            Uri uriConexao = new Uri("activemq:tcp://127.0.0.1:61616");
            Apache.NMS.ActiveMQ.ConnectionFactory fabrica = new
ConnectionFactory(uriConexao);

            using (IConnection conexao = fabrica.CreateConnection())
            {
                using (ISession sessao = conexao.CreateSession())
                {
                    IDestination destino =
SessionUtil.GetDestination(sessao, "queue://" + fila);
                    using (IMessageProducer producer =
sessao.CreateProducer(destino))
                    {
                        conexao.Start();

                        IObjectMessage objMensagem =
sessao.CreateObjectMessage(objeto);
                        objMensagem.NMSCorrelationID = identificador;
                        producer.Send(objMensagem);
                    }
                }
            }
        }

Bilubilu tetéia!



--
View this message in context: http://activemq.2283324.n4.nabble.com/No-IConnectionFactory-implementation-found-for-connection-URI-activemq-tcp-localhost-61616-tp4665743p4680252.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message