You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Denis Abramov (JIRA)" <ji...@apache.org> on 2007/02/27 00:05:03 UTC

[jira] Created: (AMQ-1182) Add failover:// to NMS client

Add failover:// to NMS client
-----------------------------

                 Key: AMQ-1182
                 URL: https://issues.apache.org/activemq/browse/AMQ-1182
             Project: ActiveMQ
          Issue Type: New Feature
          Components: NMS (C# client)
            Reporter: Denis Abramov


Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "David Keaveny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46538#action_46538 ] 

David Keaveny commented on AMQNET-26:
-------------------------------------

We are looking at a WCF/NMS-based deployment with failover support (two AMQ servers sharing a SAN for storage). I've written a very rough WCF implementation (sessionless datagram only so far, no request/response or duplex, and no sessions). I'd be interested to help out with whatever you're doing, Allan. It's good to know other people are on board and getting their hands dirty!

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes updated AMQNET-26:
----------------------------

         Assignee: Jim Gomes
    Fix Version/s: 1.1
      Component/s: ActiveMQ Client

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47097#action_47097 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Since I had a hand in this code, would you mind posting the complete URL string that you are using? Also, when does the failure occur? During ConnectionFactory(url)? CreateConnection()?

The changes in URISupport should remain (mostly) compatible with the previous version. But there was some code changed in the CreateConnection() call that dealt with URL processing. Having this additional information would go a long way to understanding and fixing this problem.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "David Keaveny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46691#action_46691 ] 

David Keaveny commented on AMQNET-26:
-------------------------------------

If it's OK by you, Allan, I'll wait until you've got the HEAD patch in place?

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46808#action_46808 ] 

Jim Gomes commented on AMQNET-26:
---------------------------------

Allan, my apologies for the inconveniences.  As you noted, I am attempting to set up for automated builds and deployment.  It's not the easiest thing to do, and I am testing some new version control theories.  Our build machine does not have the NET CompactFramework SDK installed, so it does not produce the CF version of the assemblies.  I will update the build scripts so that it will handle this more gracefully.  I am attempting to create "reference builds" of the assemblies that are known, versioned, trusted, and signed.  I'll send an e-mail to you offline when I have this fixed up.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.ActiveMQ.707373.diff, FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Christian Gross (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47146#action_47146 ] 

Christian Gross commented on AMQNET-26:
---------------------------------------

If you look at the image in the watch window you will see connection uri contents and it was tcp://192.168.1....

This failed during the connection initialization.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46686#action_46686 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Attached is a patch that doesn't work, but is a good first start to adding failover capability. It is close, however. Currently, using a failover URL the system will correctly connect to the underlying transport, but that starting logic for the transport (in sending the wire information during SyncRequest() in Connection.cs) does not return a Response thus SyncRequest() treats this as a failure and closes the connection. The logic in the failover connector does not seem to recover from that.

The basic tcp URL still works (at least I didn't break that).

The idea is the failover URL: failover://(tcp://xxx:pp?option=value&option=value,tcp://yyy:qq?option=value&option=value)?failoveroptions=value

This is correctly parsed and placed within the failover transport. Each internal transport is independent and can actually be different protocols (although only tcp is currently supported). A new class TransportFactory replicates many of the Java-based functions for ITransport-independent factory creation and usage - a proper hiding of information.

There are a lot of files added to support state management, threads (simulating some Java stuff). After implementing some things I think I found better classes, so some things will probably need replacing. Another set of eyes viewing the code will definitely help.

I am using generics in some of the classes which means that the .NET 1.1 version will not compile. I commented it out of the nant build file so that it was not a problem for me (I think that is in the patch file, so be careful if you do not want your build file affected). The generics could probably be removed with only a bit of object-level casting. That's for later.

I'll keep trying to fix the problem with the failover startup. However, assistance is desired.

That's it for now. Please reply so that we can coordinate efforts at this point.

Thanks,

-Allan



> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allan Schrum updated AMQNET-26:
-------------------------------

    Attachment: Apache.NMS.707373a.diff
                Apache.NMS.ActiveMQ.707373a.diff

The attached patches (Apache.NMS.707373a.diff and Apache.NMS.ActiveMQ.707373a.diff) are the patches to add failover support to the client software. One is applied to the Apache.NMS project, the other to the Apache.NMS.ActiveMQ project (both at trunk-level). This code is a translation of the original Java code mapped to the current Apache.NMS.ActiveMQ architecture. This should be applied to version 707373 which was HEAD at the time I created these patches (applying to the current HEAD should probably work as well).

The previous patch (FailoverPatch.diff) should not be used and should be discarded.

Simple testing shows that basic reconnect works. Testing on handling non-automatically acknowledged messages and transactional messages still is required. Various failover broker configurations should be verified as well.

Let the games begin!

Regards,

-Allan

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff, FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Issue Comment Edited: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47183#action_47183 ] 

aschrum edited comment on AMQNET-26 at 11/7/08 9:24 AM:
-------------------------------------------------------------

The attached patch (Apache.NMS.709310.diff) should address the URISupport.cs problem identified by Christian. The parseComposite() routine now correctly parses singleton URI into a composite structure so that the connection can be completed. Support for failover is still maintained.

I have discovered two additional issues that need to be addressed. The first is Microsoft's Uri class will not accept a failover URL of the form:

failover://(tcp://localhost,tcp://localhost)

because the implied host (that which is in the parenthesis) is not a valid hostname (I guess). While the scheme is not a publicly recognized scheme I would think Microsoft would defer interpretation at that level, or provide a way to supply a private scheme parser. I couldn't find one. Thus the above syntax fails. Funny thing is, the following works:

failover:(tcp://localhost,tcp://localhost)

though it is not a legal format either (missing forward slashes). With some investigation, the following does work and is a valid URL from the Uri class's point of view:

failover://localhost/(tcp://localhost,tcp://localhost)

The explicit host and path (trailing slash) provide sufficient context for Uri to accept it. Even though we ignore the failover host (the first localhost) for failover processing, this will probably need to be the way a correct URL is provided for failover operation.

Second, the recent changes to Apache.NMS.ActiveMQ's file OpenWire/OpenWireFormat.cs create massive delays on my system. If I revert that file back to the version 693666 (09-Sep-2008) then all my code starts working without delays. It seems that the action of writing to the bus (using Topics in my case) is delayed 120 seconds or so. Each write seems to be delayed 15 seconds. Since startup involves several writes the initialize the wire format, I suspect that a timeout variable is set to 0 (zero) which does not allow a thread-swap to take place. So it hangs. I will create a new issue for this problem.

Please test and give feedback. If it is positive, then Jim can commit the change to the repository.

-Allan

      was (Author: aschrum):
    The attached patch (Apache.NMS.709310.diff) should address the URISupport.cs problem identified by Christian. The parseComposite() routine now correctly parses singleton URI into a composite structure so that the connection can be completed. Support for failover is still maintained.

I have discovered two additional issues that need to be addressed. The first is Microsoft's Uri class will not accept a failover URL of the form:

failover://(tcp://localhost,tcp://localhost)

because the implied host (that which is in the parenthesis) is not a valid hostname (I guess). While the scheme is not a publicly recognized scheme I would think Microsoft would defer interpretation at that level, or provide a way to supply a private scheme parser. I couldn't find one. Thus the above syntax fails. Funny thing is, the following works:

failover:(tcp://localhost,tcp://localhost)

though it is not a legal format either (missing forward slashes). With some investigation, the following does work and is a valid URL from the Uri class's point of view:

failover://localhost/(tcp://localhost,tcp://localhost)

The explicit host and path (trailing slash) provide sufficient context for Uri to accept it. Even though we ignore the failover host (the first localhost) for failover processing, this will probably need to be the way a correct URL is provided for failover operation.

Second, the recent changes to Apache.NMS.ActiveMQ's file OpenWire/OpenWireFormat.cs create massive delays on my system. If I revert that file back to the version 693666 (09-Sep-2008) then all my code starts working without delays. It seems that the action of writing to the bus (using Topics in my case) is delayed 120 seconds or so. Each write seems to be delayed 15 seconds. Since startup involves several writes the initialize the wire format, I suspect that a timeout variable is set to 0 (zero) which does not allow a thread-swap to take place. So it hangs. I will make this comment on [AMQNET-121]. (See https://issues.apache.org/activemq/browse/AMQNET-121) as well.

Please test and give feedback. If it is positive, then Jim can commit the change to the repository.

-Allan
  
> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.709310.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Issue Comment Edited: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46832#action_46832 ] 

aschrum edited comment on AMQNET-26 at 10/24/08 1:02 PM:
--------------------------------------------------------------

The attached patches (Apache.NMS.707373a.diff and Apache.NMS.ActiveMQ.707373a.diff) are the patches to add failover support to the client software. One is applied to the Apache.NMS project, the other to the Apache.NMS.ActiveMQ project (both at trunk-level). This code is a translation of the original Java code mapped to the current Apache.NMS.ActiveMQ architecture. This should be applied to version 707373 which was HEAD at the time I created these patches (applying to the current HEAD should probably work as well).

The previous patch (FailoverPatch.diff) should not be used and should be discarded.

Simple testing shows that basic reconnect works. Testing on handling non-automatically acknowledged messages and transactional messages still is required. Various failover broker configurations should be verified as well.

Sample failover URL:

failover:(tcp://localhost:61616?trace=false,tcp://localhost:61616?trace=true)?randomize=true

Let the games begin!

Regards,

-Allan

      was (Author: aschrum):
    The attached patches (Apache.NMS.707373a.diff and Apache.NMS.ActiveMQ.707373a.diff) are the patches to add failover support to the client software. One is applied to the Apache.NMS project, the other to the Apache.NMS.ActiveMQ project (both at trunk-level). This code is a translation of the original Java code mapped to the current Apache.NMS.ActiveMQ architecture. This should be applied to version 707373 which was HEAD at the time I created these patches (applying to the current HEAD should probably work as well).

The previous patch (FailoverPatch.diff) should not be used and should be discarded.

Simple testing shows that basic reconnect works. Testing on handling non-automatically acknowledged messages and transactional messages still is required. Various failover broker configurations should be verified as well.

Let the games begin!

Regards,

-Allan
  
> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46690#action_46690 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

I've just did an SVN UPDATE on my project tree and saw that there were many modifications performed by Jim in his preparation for a release. I was trying to merge his changes with mine but I cannot build the vendor portion (the NUnit libraries are missing). Jim, can you update me as to how to build this now? I can build the vendor .Net 2.0 library, but the test library refuses to build due to a lack of NUnit library. I presume if I get by this then the top-level project will build correctly. After a merge I can then generate a HEAD-level patch for us to use.

David, please take a look at the patch and see if you can start seeing what I was doing. Or you may want to wait until I can get these changes updated to the HEAD version of the software.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Issue Comment Edited: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47183#action_47183 ] 

aschrum edited comment on AMQNET-26 at 11/7/08 9:21 AM:
-------------------------------------------------------------

The attached patch (Apache.NMS.709310.diff) should address the URISupport.cs problem identified by Christian. The parseComposite() routine now correctly parses singleton URI into a composite structure so that the connection can be completed. Support for failover is still maintained.

I have discovered two additional issues that need to be addressed. The first is Microsoft's Uri class will not accept a failover URL of the form:

failover://(tcp://localhost,tcp://localhost)

because the implied host (that which is in the parenthesis) is not a valid hostname (I guess). While the scheme is not a publicly recognized scheme I would think Microsoft would defer interpretation at that level, or provide a way to supply a private scheme parser. I couldn't find one. Thus the above syntax fails. Funny thing is, the following works:

failover:(tcp://localhost,tcp://localhost)

though it is not a legal format either (missing forward slashes). With some investigation, the following does work and is a valid URL from the Uri class's point of view:

failover://localhost/(tcp://localhost,tcp://localhost)

The explicit host and path (trailing slash) provide sufficient context for Uri to accept it. Even though we ignore the failover host (the first localhost) for failover processing, this will probably need to be the way a correct URL is provided for failover operation.

Second, the recent changes to Apache.NMS.ActiveMQ's file OpenWire/OpenWireFormat.cs create massive delays on my system. If I revert that file back to the version 693666 (09-Sep-2008) then all my code starts working without delays. It seems that the action of writing to the bus (using Topics in my case) is delayed 120 seconds or so. Each write seems to be delayed 15 seconds. Since startup involves several writes the initialize the wire format, I suspect that a timeout variable is set to 0 (zero) which does not allow a thread-swap to take place. So it hangs. I will make this comment on [AMQNET-121]. (See https://issues.apache.org/activemq/browse/AMQNET-121) as well.

Please test and give feedback. If it is positive, then Jim can commit the change to the repository.

-Allan

      was (Author: aschrum):
    The attached file should address the URISupport.cs problem identified by Christian. The parseComposite() routine now correctly parses singleton URI into a composite structure so that the connection can be completed. Support for failover is still maintained.

I have discovered two additional issues that need to be addressed. The first is Microsoft's Uri class will not accept a failover URL of the form:

failover://(tcp://localhost,tcp://localhost)

because the implied host (that which is in the parenthesis) is not a valid hostname (I guess). While the scheme is not a publicly recognized scheme I would think Microsoft would defer interpretation at that level, or provide a way to supply a private scheme parser. I couldn't find one. Thus the above syntax fails. Funny thing is, the following works:

failover:(tcp://localhost,tcp://localhost)

though it is not a legal format either (missing forward slashes). With some investigation, the following does work and is a valid URL from the Uri class's point of view:

failover://localhost/(tcp://localhost,tcp://localhost)

The explicit host and path (trailing slash) provide sufficient context for Uri to accept it. Even though we ignore the failover host (the first localhost) for failover processing, this will probably need to be the way a correct URL is provided for failover operation.

Second, the recent changes to Apache.NMS.ActiveMQ's file OpenWire/OpenWireFormat.cs create massive delays on my system. If I revert that file back to the version 693666 (09-Sep-2008) then all my code starts working without delays. It seems that the action of writing to the bus (using Topics in my case) is delayed 120 seconds or so. Each write seems to be delayed 15 seconds. Since startup involves several writes the initialize the wire format, I suspect that a timeout variable is set to 0 (zero) which does not allow a thread-swap to take place. So it hangs. I will make this comment on [AMQNET-121]. (See https://issues.apache.org/activemq/browse/AMQNET-121) as well.

Please test and give feedback. If it is positive, then Jim can commit the change to the repository.

-Allan
  
> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.709310.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Issue Comment Edited: (AMQNET-26) Add failover:// to NMS client

Posted by "David Keaveny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46538#action_46538 ] 

ctrlaltdel edited comment on AMQNET-26 at 10/16/08 10:43 PM:
----------------------------------------------------------------

We are looking at a WCF/NMS-based deployment with failover support (two AMQ servers sharing a SAN for storage). So far I have been working on a very rough WCF implementation, apart from the work that Spring.NET are doing (sessionless datagram only so far, no request/response or duplex, and no sessions). I'd be interested to help out with whatever you're doing, Allan. Since this code goes into the NMS code, my WCF code should then just pick up whatever connection is passed to it by the factory.

It's good to know other people are on board and getting their hands dirty!

      was (Author: ctrlaltdel):
    We are looking at a WCF/NMS-based deployment with failover support (two AMQ servers sharing a SAN for storage). I've written a very rough WCF implementation (sessionless datagram only so far, no request/response or duplex, and no sessions). I'd be interested to help out with whatever you're doing, Allan. It's good to know other people are on board and getting their hands dirty!
  
> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46693#action_46693 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Clean checkout of HEAD does not build for me. I am missing the NUnit libraries, so all the TEST libraries cannot be built. Is there a simple way to build all without the TEST libraries being built? Or can we get the NUnit libraries included with the project? Or get instructions on what to do?

Thanks,

-Allan

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Resolved: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-26.
-----------------------------

    Resolution: Fixed

Applied patch submitted by Allan Schrum.  Please enter any new problems as separate JIRA issues.  This issue has grown pretty long in the tooth.  (For non-English speakers, this means this item has been completed.)

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.709310.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46490#action_46490 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Hearing nothing to contradict my earlier remarks, I have started converting various Java routines to C#. The critical ones associated with ConnectionStateTracker() in the activemq\activemq-core\src\main\java\org\apache\activemq\state directory have been converted and were added to a new directory at Apache.NMS.ActiveMQ\src\main\csharp\State. 11 new files were added. Additionally, in the Transport directory I have created a new Failover directory to hold the three Java sources that support failover recovery. I am currently working on those files.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46413#action_46413 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

I wish to contribute towards the resolution of this issue. As such, I have been examining the Java implementation with hopes to understand it sufficiently so that I can replicate the functions in C#. Below are my comments as to the steps or actions required to fix this problem. If others can comment or correct my comments, then we can get started on this. If others are willing to help with the coding or testing, that would be great.

All that I state below is what I have gleaned from the Java code. There is some interpretation of the code that may be in error. If so, then those with sufficient knowledge should correct my interpretation.

A quick jump through the stack: We start with a connection factory derived from ActiveMQConnectionFactory() (C# ConnectionFactory()). This connection factory returns an IConnection which, as part of the process, creates an ITransport using a TransportFactory(). In Java, the resource information allows for various implementations of ITransport which includes FailoverTransport(). Different from C#, the Java implementation breaks out the logic for creating a transport so that it can be overridden by subclasses if desired. Not sure if we need that or not.

In the TransportFactory, it all starts with the URI associated with the connection. The "failover:(URI1, URI2, ..., URIn)" syntax is passed to the TransportFactory.connect() to create the associated ITransport object. Looking at TransportFactory.connect() it uses findTransportFactory() to determine which class to load based upon the location passed. The URI.getScheme() method returns "failover" which is used to load the failover transport factory (org.apache.activemq.transport.failover.FailoverTransportFactory.java). This is based upon the META-INF information which redirects "failover" to that class.

At this point we have a choice. We can allow for dynamic loading of classes (which can be done - not too hard) allowing for a similar run-time loading of appropriate classes to support various ITransport interface classes, or we can punt and do something easy for a compile-time loading of classes. My simple vote is to do a compile-time reference to the class which we can move to run-time loading at a future date. I have done run-time loading of classes, so if desired I can explain how I did it, but do we want that level of complexity at this point?

Tabling that issue, the fundamental questions now reside around the differences between TransportFactory() and FailoverTransportFactory(), followed by the differences between Transport() and FailoverTransport().

The Java version of TransportFactory includes support for composite connections. This is used to support reliable and HA connections. Basically, composite connections represent a list of URIs associated with a connection.

Most of the extended functionality of the transports is handled through subclassing. Want a ITransport that does X, then create a new subclass of Transport() or something that implements ITransport() and now you have a new feature X. However, there is a client-side and server-side for feature X (e.g. SSL). For SSL support, the client must understand how to connect properly, and the server needs to understand how to accept the connection properly. Thus  some of the classes that support ITransport() also support TransportServer() which handles the server-side of things (I think this is correct). Not all features require this to work properly. For instance, the failover: capability is a client-only feature that does not require server-side coding.

If we are to round-out all the neat features of the Java-based interfaces to be supported here with .NET, then we need to carefully support this dual concept of client- and server-side coding for the features.

I think that is the level of complexity that is implied by all the features in the Java-based code. Essentially it breaks down into two sets of supported interfaces (Transport and TransportServer) which are required depending upon the specific feature. The rest of the feature code seems to be dependent upon the features being implemented.

OK - so what does this mean for our implementation? I would suggest the following:

1.	We create a Failover directory for our files with an implied "Failover" namespace extension.
2.	Create a FailoverTransportFactory.cs and FailoverTransport.cs classes that will implement our new features (details to follow soon).
3.	Explicitly reference this new namespace and based upon the schema passed either call TcpTransportFactory() or FailoverTransportFactory(). Using this ITransportFactory create the appropriate ITransport class.
4.	As we add new features, we can then decide to continue with this explicit compile-time structure of referencing the classes, or we can think about a run-time loading of classes. But that is for the future.

The key feature of FailoverTransportFactory() and FailoverTransport() is the ability to parse and handle multiple URIs. There is logic to randomly (or sequentially) try to connect to each URI until success. If successful, then life is good. If there is a failure, then a try to reconnect is possible as well as tries to connect to the other URIs specified. Of course, each URI can have it own connection qualifiers so each needs to be handled independently.

At this point I will stop for comments. The details of how FailoverTransport() should be implemented are mostly in the Java code, but of course, details vary for C#.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46415#action_46415 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

OK, while waiting for comments, I have been looking at the Java FailoverTransport() in greater detail. There is a level of detail in that implementation that I do not think we can support (initially) for the C# FailoverTransport(). For instance, the Java version tracks the current state of a transaction so that it can try to replay all the commands (messages) so that the transaction can be reprocessed on another connection. The necessary support for this exists in the Java world, but not in our reduced interface world.

If I remember correctly, a message from the broker can be read and automatically acknowledged, read and manually acknowledged, sent, or be part of a transaction, or various connection failures. Failover capability can work in each area only to a small amount.

For clarity, I am looking for a client state transition diagram (or will make one) so that we can see how failover capability can respond in each state. From that diagram I think it will be easier to determine what we can support.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Resolved: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes resolved AMQNET-26.
-----------------------------

    Resolution: Fixed

Marking this item as resolved based upon the contribution from Allan.  Even though more work may need to be done in regards to failover, any specific problems or enhancements should be logged as new and separate issues.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allan Schrum updated AMQNET-26:
-------------------------------

    Attachment: Apache.NMS.709310.diff

The attached file should address the URISupport.cs problem identified by Christian. The parseComposite() routine now correctly parses singleton URI into a composite structure so that the connection can be completed. Support for failover is still maintained.

I have discovered two additional issues that need to be addressed. The first is Microsoft's Uri class will not accept a failover URL of the form:

failover://(tcp://localhost,tcp://localhost)

because the implied host (that which is in the parenthesis) is not a valid hostname (I guess). While the scheme is not a publicly recognized scheme I would think Microsoft would defer interpretation at that level, or provide a way to supply a private scheme parser. I couldn't find one. Thus the above syntax fails. Funny thing is, the following works:

failover:(tcp://localhost,tcp://localhost)

though it is not a legal format either (missing forward slashes). With some investigation, the following does work and is a valid URL from the Uri class's point of view:

failover://localhost/(tcp://localhost,tcp://localhost)

The explicit host and path (trailing slash) provide sufficient context for Uri to accept it. Even though we ignore the failover host (the first localhost) for failover processing, this will probably need to be the way a correct URL is provided for failover operation.

Second, the recent changes to Apache.NMS.ActiveMQ's file OpenWire/OpenWireFormat.cs create massive delays on my system. If I revert that file back to the version 693666 (09-Sep-2008) then all my code starts working without delays. It seems that the action of writing to the bus (using Topics in my case) is delayed 120 seconds or so. Each write seems to be delayed 15 seconds. Since startup involves several writes the initialize the wire format, I suspect that a timeout variable is set to 0 (zero) which does not allow a thread-swap to take place. So it hangs. I will make this comment on [AMQNET-121]. (See https://issues.apache.org/activemq/browse/AMQNET-121) as well.

Please test and give feedback. If it is positive, then Jim can commit the change to the repository.

-Allan

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.709310.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46546#action_46546 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Jim, Assuming I get somewhere with this how do I get the modified sources up to the system (or you)? I can do an SVN EXPORT and let you figure out where new files have been added, but would like to know what your preferred method is.

I am still resolving some compile-time errors induced by my translation of the Java equivalent code to C#. If we had a sandbox SVN repository, I could check in my current snapshot for others to help. Jim, is something like that possible? If not, I hope to do some of my first tests later today.

David, thanks for the offer. I would like your assistance if we can resolve a couple of these issues mentioned above. Assuming I get to the testing stage soon, it may be that your assistance with testing will be most valuable.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Gomes updated AMQNET-26:
----------------------------

    Priority: Critical  (was: Major)

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46809#action_46809 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Eureka! The basics seem to work. I can connect using a failover transport and hold a conversation. Basically I can repeat with a failover transport the same functions I can do with a tcp transport. All the actual failover logic (reconnect, resend of messages, etc.) are untested. That is for tomorrow. Although I did a quick reconnect test and it worked fine! Using TcpView I closed the connection and the client reestablished it with no application-level impact.

Testing will require some assistance. There are many operating modes that need to be verified.

I shall construct patches and submit them tomorrow AM for your review. These can be applied to the latest(?) version 707373 (and most likely HEAD if it has changed).

-Allan

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.ActiveMQ.707373.diff, FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allan Schrum updated AMQNET-26:
-------------------------------

    Attachment:     (was: FailoverPatch.diff)

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allan Schrum updated AMQNET-26:
-------------------------------

    Attachment: FailoverPatch.diff

This is the patch for the changes discussed above.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Reopened: (AMQNET-26) Add failover:// to NMS client

Posted by "Christian Gross (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Gross reopened AMQNET-26:
-----------------------------------


At the url http://www.devspace.com/~christianhgross/images/brokenuri.jpg you will find an image of a broken uri problem.

Code that was working broke when I did an update of the sources and a recompilation of the source code.

I looked at the subversion log record and I found this new feature was the only thing that seemed to have been updated, and hence came to the conclusion that this code might have problems.

To verify if it was my code or this new code I rolled back my version control system to the old assemblies of ActiveMQ and the code worked fine again. As a further step I used reflector to analyze what code of URISupport I am using. I see that it is the code before the change made by this issuea.



> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.707373a.diff, Apache.NMS.ActiveMQ.707373.diff, Apache.NMS.ActiveMQ.707373a.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Moved: (AMQNET-26) Add failover:// to NMS client

Posted by "james strachan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

james strachan moved AMQ-1182 to AMQNET-26:
-------------------------------------------

    Component/s:     (was: NMS (C# client))
            Key: AMQNET-26  (was: AMQ-1182)
        Project: ActiveMQ .Net  (was: ActiveMQ)

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>            Reporter: Denis Abramov
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46692#action_46692 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

No problem. I am trying a fresh checkout to see if I can build Jim's current state of the project. Then I'll apply the patch to see if I can update HEAD that way. More details tomorrow.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Jim Gomes (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46552#action_46552 ] 

Jim Gomes commented on AMQNET-26:
---------------------------------

The mainline trunk is open for this development.  I am OK with checking in broken code to the trunk at this point.  I have a stable 1.0.0 branch created.  I am just about finished creating binaries from this branch.  This feature is important enough to facilitate speedy development.  For traceability of development, let's continue using this item to track contributions.  If you can create a patch file, and attach it to this item (checking the Grant ASF License option), then I will get it applied as quickly as possible.  Each new patch should be made against the latest version after the previous patch has been applied to the trunk.  That will make merging and incremental development easier.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "David Keaveny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46688#action_46688 ] 

David Keaveny commented on AMQNET-26:
-------------------------------------

I've literally just this moment come out of a meeting where we were discussing the current state of play for AMQ failover support in our project, so I should be able to devote some time to this. Just let me know what needs doing, and I can add it to our product backlog.

> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Commented: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46419#action_46419 ] 

Allan Schrum commented on AMQNET-26:
------------------------------------

Please disregard much of my previous commentary. While somewhat true, it was a way to organize my thoughts in the process of understanding what's going on with ActiveMQ NMS. Sorry for the extra traffic, but not too much.

Failover mode for broker where we wish to use failover: syntax means that the broker is setup in a failover layout. Our approach should support any failover configuration of brokers. Each configuration guarantees that persistent messages written by the broker are persisted before returning control back to the client (for Producers). For Consumers, this varies depending upon which mode we are operating and when a failure might occur.

===
Connections have a transport which is used to communicate with the broker. This is typically a TCP connection since we are using a wire protocol to connect to the broker. All the other non-TCP modes only work from Java. The Connection has as part of its object data the associated Transport.

Sessions are created from Connections. A single Connection can have multiple Sessions. The Session has as part of its object data the associated Connection. Session Acknowledgement States: Auto, Client, Dups_OK, Transacted, Individual_Ack

Consumers and Producers are created from Sessions. A single Session can have multiple Consumers and Producers. Each Consumer has a thread dedicated to manage receiving messages. The Consumer object has the associated Session object as part of its data.

Messages are retrieved using Consumers (either by calling Receive() or asynchronously).

====
Session Mode: Auto

In this mode all Consumers of messages automatically acknowledge the message. A failure will occur during a Receive() or asynchronously an Exception will be thrown indicating an I/O error (or something similar). In this situation, a simple reconnect followed by tries of other servers is sufficient. The Consumer should continue where it left off. Since each Consumer uses its Session object which uses its Connection object to reference the Transport object, changing the Transport associated with the Connection should be sufficient (more accurately, hiding that change within the FailoverTransport should be sufficient).

===
Session Mode: Manual

Similar to mode Auto, when each consumed message is acknowledged, it no longer requires tracking by the Transport. However, each Message that remains unacknowledged must be tracked. The reason is if there is an error during processing of these messages, then the non-acknowledged messages are still on the queue / topic. To handle this situation, all Messages that are consumed must be registered by the Transport. When the Message is acknowledged then the associated Message(s) must be removed from registration by the Transport. Care must be done here. If Client_Acknowledge is used then all Messages registered with the Transport should be cleared. If Individual_Acknowledge is used then only that Message is removed from the Transport.

===
Session Mode: Transactional

In this situation all Consumed Messages and all Published Messages must be tracked individually until the transaction is committed or rolled back. If an error occurs and the connection is reestablished, then the order of consumed and published messages must be recreated on the newly reestablished connection to replicate the previous transaction. Normally, re-consuming the same messages should not be a problem in processing the transaction.

>From the application point of view, something may or may not have happened. The processing performed by the application was performed based upon the content of the Messages received by the application. The same input should generate the same output, so all we should do is re-consume the same messages to return to the same point as we were when the error occurred.

===
Producers

Outside of the transaction, Producers of messages will independently publish and, if they succeed, complete all that is necessary.

Inside the transaction, the discussion above covers what is required to do to maintain status.

======
As part of the FailoverTransport implementation, we must replicate much of the same logic in the Java ConnectionStateTracker() to preserve enough information to handle failover operation. The Transport associated with the Connection must make use of the TransportFilter interface so that when the FailoverTransport class is used it effectively select the currently active Transport, or reconnects / connects to another Transport and continues on. 

However, in reconnecting or connecting to a new transport, the previous state of the Transport connection must be restored. This is what is managed by the ConnectionStateTracker().


> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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


[jira] Updated: (AMQNET-26) Add failover:// to NMS client

Posted by "Allan Schrum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQNET-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Allan Schrum updated AMQNET-26:
-------------------------------

    Attachment: Apache.NMS.707373.diff
                Apache.NMS.ActiveMQ.707373.diff

OK - I got it to compile. I now understand what Jim was doing in his reorganization of Apache.NMS. It used to be that the Apache.NMS portion was fully loaded under Apache.NMS.ActiveMQ as an external link. Now, only a fixed, deployed version of Apache.NMS is referenced by Apache.NMS.ActiveMQ. Because of that, and because that deployed version did not include .NET 2.0 CF, my builds were failing.

Also, the nunit.framework.extensions.dll is needed by the Apache.NMS.ActiveMQ project. This required a change in the nant.build (patch attached).

So, to get it to work for me I had to check out the Apache.NMS project (trunk) and build the the project (no problems there). I wanted to create the "deploy" directories but the only target that would do so is "deploy-all". This also does an SVN COMMIT which is not what I want to do. So I created a new target called "deploy-local" which is called by "deploy-all" so that I could do what was needed without the SVN COMMIT. Is there a better way to do this?

After copying the files from Apache.NMS to Apache.NMS.ActiveMQ, I could now build the Apache.NMS.ActiveMQ project after making the nunit change referenced above (patch attached).

>From here, I shall attempt to add my previous patches for failover support. Since the project is in two pieces, I'll need to break up my previous patch into smaller pieces that can be applied to each separately.



> Add failover:// to NMS client
> -----------------------------
>
>                 Key: AMQNET-26
>                 URL: https://issues.apache.org/activemq/browse/AMQNET-26
>             Project: ActiveMQ .Net
>          Issue Type: New Feature
>          Components: ActiveMQ Client
>            Reporter: Denis Abramov
>            Assignee: Jim Gomes
>            Priority: Critical
>             Fix For: 1.1
>
>         Attachments: Apache.NMS.707373.diff, Apache.NMS.ActiveMQ.707373.diff, FailoverPatch.diff
>
>
> Please add failover:// to C# NMS Client. I would add it but I don't know how to resume a stream once it is broken.

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