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

Mark Gellings commented on AMQNET-159:
--------------------------------------

Okay.  Thanks Timothy.

Last question is whether to make this the default behavior then.  Should it be 
opt in or opt out?  

Originally I thought opt in so as not to modify the default behavior of NMS 
ActiveMQ, but I don't see why anyone wouldn't want the provider to be faster 
connecting to the master broker when using the failover protocol.

> Make failover protocol optionally asynchronously connect to sockets
> -------------------------------------------------------------------
>
>                 Key: AMQNET-159
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-159
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ
>    Affects Versions: 1.1.0
>         Environment: XP, Windows Server 2008, Sql Server 2008
>            Reporter: Mark Gellings
>            Assignee: Jim Gomes
>             Fix For: 1.2.0
>
>         Attachments: FailoverAsyncConnect.patch
>
>
> The current failover transport synchronously attempts to socket connect to a 
> broker.  Preferably we would first socket connect trying the master address 
> in the failover address to avoid a socket connection timeout.  When the first 
> tcp address in the failover address is the slave, its connectors are not 
> started, and .NET takes around 20 - 25s to timeout trying to socket connect 
> to the slave.  Thus the client is waiting 20-25s to submit a message when the 
> session is first established.
> Since the first tcp address in the failover address is never guaranteed to be 
> the master, I've coded an enhancement that optionally allows to 
> asynchronously socket connect utilizing all the tcp addresses in the failover 
> address.  I have a patch you can apply.
> The following failover address is an example of how to use the async connect.
> private static Uri _uri = new 
> Uri("failover:(tcp://WAMQDEV1.qg.com:10083,tcp://SXMQDEV1.qg.com:10083)?AsyncConnect=true&AsyncTimeout=20000");
> This will cause the failover transport to attempt connecting to WAMQDEV1 and 
> SXMQDEV1 at the same time to avoid the impact of any socket connect timeouts. 
>  First broker connected to becomes the transport utilized.  If WAMQDEV1 
> broker is not running or is running the slave broker then if SXMQDEV1 is 
> running the master broker the client will connect to SXMQDEV1.
> AsyncTimeout is the max time in milliseconds to wait for a transport to be 
> initialized.  So if both brokers are down, in the example above, after 20000 
> milliseconds the normal retry logic will kick in.

-- 
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