[ 
https://issues.apache.org/activemq/browse/AMQNET-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=52052#action_52052
 ] 

Timothy Bish commented on AMQNET-160:
-------------------------------------

Am understanding this correctly?  You have modified the Failover transport to 
fail if it can't initially connect to any of its designated hosts when the 
start method is called?

I'm not sure that's really what you want for a Failover transport.  By changing 
it to do so you now take away a pretty valuable feature in that the clients are 
now dependent on the order in which things in the distributed system come up.  
So if the Broker is on a server that starts up slowly and I start up the entire 
system clients and servers I have to ensure that at least one of my servers 
beats all the clients and gets into a steady state otherwise my clients all 
fail.  

I think this was really a non issue as you could just set the 
maxReconnectAttempts property to something other then zero and the transport 
would eventually give up the connection attempt and throw an exception.

> Connecting to non-existing host does not raise Exception when using failover 
> protocol
> -------------------------------------------------------------------------------------
>
>                 Key: AMQNET-160
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-160
>             Project: ActiveMQ .Net
>          Issue Type: Bug
>          Components: ActiveMQ Client
>    Affects Versions: 1.0
>         Environment: Windows XP/Windows 2003 , .NET Framework 2.0 (Broker 
> running Ubuntu 8.04 + ActiveMQ 5.2)
>            Reporter: Michel Van Hoof
>            Assignee: Jim Gomes
>             Fix For: 1.1
>
>
> When using the failover protocol, there is no exception raised when trying to 
> connect to non-existing host.
> Example:
> using System;
> using System.Collections.Generic;
> using System.Text;
> using Apache.NMS;
> using Apache.NMS.ActiveMQ;
>     class ExceptionTest
>     {
>         private readonly IConnectionFactory oConnfact;
>         private readonly IConnection oConn;
>         private readonly ISession oSess;
>         private readonly IMessageConsumer oConsumer;
>         private string sConnectionUri = "failover:(tcp://unknownhost:61612)";
>         // Using this connectionstring it does fail.
>         //private string sConnectionUri = "tcp://unknownhost:61612";
>         public ExceptionTest()
>         {
>             oConn.ExceptionListener += new ExceptionListener(OnException);
>             this.oConnfact = new ConnectionFactory(sConnectionUri, 
> "CLIENT.ID");
>            
>             oConn.ExceptionListener += new ExceptionListener(OnException);
>             this.oConn = oConnfact.CreateConnection();
>             oConn.RequestTimeout(new TimeSpan(0, 0, 2)); 
>             // Code hangs here
>             oConn.Start();
>             //Rest does not really mather anymore since it hangs
>             
>         }
>         void OnEx(Exception exception)
>         {
>                 throw new Exception("The method or operation is not 
> implemented.");
>         }
>         public void OnException(Exception ex)
>         {
>             Console.WriteLine("You made a BooBoo: {0} ", ex.ToString());
>         }
>     }
> If you change the connectionstring to "tcp://badhostname:xxxx" , the 
> exception does occur. 
> It also seems to ignore the RequestTimeout.
> This blocks the application thread indefinately since there is no way to 
> recover from it (no exception thrown).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to