activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From semog <e.se...@gmail.com>
Subject Re: [Apache.NMS.ActiveMQ]using FailoverTransport
Date Fri, 30 Jan 2009 16:22:10 GMT

I haven't tested out the failover code yet, but I've been told that it is
working.  I would suggest taking out the failover: specifier in your
connection string to see if a normal connection works.  Then work up to
using failover.


wangchao wrote:
> 
> Hello everyone:
>     I encountered a problem when messaging with ActiveMQ.
>     I'm trying to achieve that,sending message to particular ActiveMQ
> Broker no mater it's running or not.And I found the failoverTransport.So I
> wrote some codes as below to test:
> 
>             NMSConnectionFactory fact = new
> NMSConnectionFactory("activemq:failover:tcp://localhost:61616");
>             using (IConnection connection = fact.CreateConnection())
>             {
>                 using (ISession session = connection.CreateSession())
>                 {
>                     SysConsole.WriteLine("Input something to send,<enter>
> for quit。");
>                     IDestination dest = session.GetQueue("TEST.FOO");
>                     using (IMessageProducer producer =
> session.CreateProducer(dest))
>                     {
>                         string input = SysConsole.ReadLine();
>                         while (!string.IsNullOrEmpty(input))
>                         {
>                             IMessage message =
> session.CreateTextMessage(input);
>                             producer.Send(message);
>                             input = SysConsole.ReadLine();
>                         }
>                     }
>                 }
>             }
> 
>     And The Problome is that the process was blocked at creating
> Session(the bold code) even when the broker is running.Is this a correct
> using for failoverTransport?If so,what's wrong with my code above?
> 
> thanks
> 

-- 
View this message in context: http://www.nabble.com/-Apache.NMS.ActiveMQ-using-FailoverTransport-tp21303879p21750420.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message