You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Rafael Pileggi <ch...@hotmail.com> on 2014/04/13 00:10:31 UTC

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

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.