9 Replies Latest reply on Feb 25, 2011 5:49 PM by Rupert Smith

    High Availability and Enterprise Integration

    Rupert Smith Newbie

      Hi,

       

      I have written a wrapper library that communicates with a legacy system (EIS), and am now looking into integrating this library for applications running on JBoss AS. In particular I have been asked to look into adding HA support on the service to the EIS. Each EIS resource (a TCP connection under the hood), can only be active from one node in the JBoss cluster at a time.

       

      I would also like to add HA support to the EIS library, not just for JBoss, but for other application servers too, or possibly Spring or whatever bespoke arrangement someone might dream up.

       

      My question is: Is writing a Resource Adapter wrapper for my library the correct way to go about doing this? An RA has methods for managing the lifecycles of 'connections' and 'endpoints', and can be configured so that only a singleton instance of the resource can exist in each server node and so on. Does JBoss provide the necessary hooks into the RA wrapper to make the underlying resource HA to the JBoss cluster?

       

      At this stage a lot of the details are not really clear to me. I'm just trying to find out it resource adapters are generally the right way to go, or am I way off on the wrong direction on this.

       

      Thanks for your help.

       

      Rupert

        • 1. High Availability and Enterprise Integration
          Rupert Smith Newbie

          I should also add:

           

          The communication with the EIS will, in this instance, be initiated by messages taken from a JMS queue. The EIS resource can be made to look transactional. I do not intend to use XA and 2-phase commits, but I think I can just leave that unimplemented in the RA wrapper, and opt for local transactions only. I will use the 1.5 phase commit design, where the asynchronous messaging resource that a message is received upon, is committed last. In the case of failure and redelivery, the resend flag will be used to trigger a de-duplication check against the EIS.

           

          The above doesn't really affect the HA issue, but just to try and give a fuller picture of what I am trying to do and to shoe-horn into the RA model.

          • 2. High Availability and Enterprise Integration
            Wolf-Dieter Fink Master

            We have done this by using a JCA connector with multiple sockets.

            In your case I think you might configure different sockets for each JBoss cluster instance.

            • 3. High Availability and Enterprise Integration
              Rupert Smith Newbie

              Wolf-Dieter Fink wrote:

               

              We have done this by using a JCA connector with multiple sockets.

              In your case I think you might configure different sockets for each JBoss cluster instance.

               

              You mean you ran one JBoss instance, with your JCA resource adapter running in it, but had multiple sockets out from that to the systems in question, multiple sockets being there for high availability, should one fail?

               

              I'm more concerned right now about what will happen, if the JBoss instance goes down. I want a clustered JBoss setup, so that one node can go down and the others will take over.

               

              The system in question, being connected to over the sockets, only supports one socket per logical resource at a time. However, it uses a reliable protocol that can reestablish the session state in the event of a failed connection. The resource adapter needs to coordinate this, so that only one RA bean is active on each JBoss instance at a time, and that each connection the RA makes to each resource is only active on one instance at a time.

               

              So I'm wondering does JCA provide the necessary hooks for JBoss to inform it when RA beans and endpoints become active/failed on other instances of the cluster for this mutually exclusive assignment of resources to nodes. Or is there some more proprietary JBoss interface I might use to accomplish this, or perhaps some other standardized Java interface? I think JCA provides at least some of what I need, I'm just not sure exactly how much.

              • 4. High Availability and Enterprise Integration
                Wolf-Dieter Fink Master

                nearly.

                In a cluster we deploy a JCA connector with multiple socket connections to each JBoss member.

                So a JBoss node can be down or one of our backend systems and JBoss or the implemented JCA connector will do the failover (if no Tx is active )

                 

                So I think our case is different because we have no exclusiv connect. There is no need to inform other instances.

                 

                Your approach looks different.

                • 5. High Availability and Enterprise Integration
                  Rupert Smith Newbie

                  So I think our case is different because we have no exclusiv connect. There is no need to inform other instances.

                   

                  Yes, I need some way to inform other instances, so that resources can be failed over if one goes down.

                   

                  I am wondering does JBoss provide a way to support resource adapters in an active/passive setup? i.e. start() one and only have one active within the cluster at any one time, and only start() another when the original has failed?

                   

                  OR

                   

                  Do I need to roll my own mechanism? i.e. Set a resource owner in a database row with a timeout, and periodically renew the lease on the active instance, and atomically attempt to take stale leases on the passive instances?

                  • 6. High Availability and Enterprise Integration
                    Wolf-Dieter Fink Master

                    I think that your requirement is a bit special and you have to implement it by yourselve.

                    • 7. High Availability and Enterprise Integration
                      Rupert Smith Newbie

                      Wolf-Dieter Fink wrote:

                       

                      I think that your requirement is a bit special and you have to implement it by yourselve.

                       

                      Its not so special. For example, in a JBoss cluster there can be one JMS master (the message broker?) and many JMS clients. The master can be moved around as nodes fail, but there must only be one active at any one time. JMS interfaces to the application server through JCA. So I am not the first to attempt such a setup.

                       

                      I may as well just download the sources and start looking through it...

                      • 8. High Availability and Enterprise Integration
                        Wolf-Dieter Fink Master

                        This is the JBossMQ as HAsingleton (JBossMessaging works different since 5.x).

                        But in this case all requests must be routed through the HAsingleton instance.

                        I'm not sure whether that is what you want

                        • 9. High Availability and Enterprise Integration
                          Rupert Smith Newbie

                          Wolf-Dieter Fink wrote:

                           

                          This is the JBossMQ as HAsingleton (JBossMessaging works different since 5.x).

                          But in this case all requests must be routed through the HAsingleton instance.

                          I'm not sure whether that is what you want

                          It is indeed what I want. I want my resource adapter available on every node in the cluster, but only one active at a time. All traffic to the EIS is to be routed through it. It will take its data of a JMS queue, so long as only one is active and reading the queue, no messages will be taken off the queue an not acted upon by a passive node.

                           

                          Is there some way of deploying a resource adapter to JBoss and marking it so that only instance will be active in the cluster at any one time? At the moment I am looking at implementing the active/passive mechanism myself, but would like to know what JBoss offers to support this. Looks like the answer here is HASingleton. Thats a JBoss specific mechanism, in general I'd like to make it application server agnostic, where possible. I'm sure I can use HASingleton and introduce some further level of abstraction to keep it relatively agnostic if HASingleton is the only way to go.

                           

                          At some point I plan to move to an active/active setup. Each EIS session will only be active on one node at a time, but all resource adapters can be active simultaneously, just load balancing the sessions amongst themselves. Even if there is a way of deploying the adapter active/passive, I assume JBoss has no way of knowing anything about the EIS sessions, so will have to roll my own exclusive session locking mechanism there?