Announcement Announcement Module
Collapse
No announcement yet.
Running inbound channel adapters on HA-cluster architecture Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running inbound channel adapters on HA-cluster architecture

    Hi Spring Integration users, experts,

    I'm facing the following issue. My web-app runs on the HA-singleton configuration which is one active server and one backup server that is used in case of failure. When app is deployed to the regular - active server it is deployed to the backup one as well. Keeping this in mind all inbound channel adapters are started on both app server instances which causes strange app behavior (some resources are locked, stale data is transfered between channels etc.).

    The temp solution that comes to my mind is to set the auto-startup parameter for all inbound channels to false and enable it only on the active server instance. The question is is this possible to change it somehow during app runtime? Any ideas on how to tackle this?

    Any other ideas?

    Your help is really appreciated.

    Wish you all the best for 2011.

    Regards,
    Krzysztof

  • #2
    One idea is to use the "Control Bus" functionality to start/stop the components at runtime. You can read about that functionality here: http://static.springsource.org/sprin...e/#control-bus

    Comment


    • #3
      Originally posted by Mark Fisher View Post
      One idea is to use the "Control Bus" functionality to start/stop the components at runtime. You can read about that functionality here: http://static.springsource.org/sprin...e/#control-bus
      Thanks for letting me know about "Control Bus" functionality. I went through this short description on how to send messages via operationChannel but unfortunately it is not clear for me how we get reference to the operationChannel.

      Code:
      Message operation = MessageBuilder.withPayload("@myServiceBean.shutdown()");
      ...
      // how can we get this reference?
      operationChannel.send(operation);
      In my case I would like to use service that is represented in spring application context as a singleton bean and inject reference to the control bus operationChannel, how could I achieve this?

      Regards,
      Krzysztof

      Comment


      • #4
        Originally posted by krzychu View Post
        Thanks for letting me know about "Control Bus" functionality. I went through this short description on how to send messages via operationChannel but unfortunately it is not clear for me how we get reference to the operationChannel.

        Code:
        Message operation = MessageBuilder.withPayload("@myServiceBean.shutdown()");
        ...
        // how can we get this reference?
        operationChannel.send(operation);
        In my case I would like to use service that is represented in spring application context as a singleton bean and inject reference to the control bus operationChannel, how could I achieve this?

        Regards,
        Krzysztof
        See it here http://forum.springsource.org/showth...d=1#post337619

        Comment


        • #5
          Originally posted by skram View Post
          Thanks a lot.

          Unfortunately I'm facing another issue and I described it in that thread.

          Comment


          • #6
            I think that you're heading for some threading issues if you decide to shutdown the context at runtime, instead of preventing it from starting.

            Why would auto-startup="#{conf.isActiveServer()}" not work?

            Comment


            • #7
              That's correct. Do you know how this "conf.isActiveServer()" could be retrieved from the JBoss environment in the easy way? As far as I know you should configured MBean and then access this MBean via HA-JNDI and then inject a reference in the spring context. I think that it is a quite complicated task.

              Other thing if you manage to get this "#conf.isActiveServer()" you still need the functionality to stop all inbound adapters at runtime in case when after the failure all the traffic will be routed to the master node again. Then the all processing should be switched off on the backup node.

              Comment


              • #8
                Yeah, I know I left the implementation as an exercise to the reader, it's a complex problem and I'm not solving it for you here, I assume you were not expecting that

                You're right about needing an option to stop at runtime in case of a switchover, but in that case you also have the option to wait for the inbound adapters to be stopped. In case of concurrent startup all bets are off. So, you need both.

                Comment


                • #9
                  Hi,

                  Did someone find out a simple way to lock a file in a cluster env or "conf.isActiveServer()" is the only option?

                  Thanks

                  Comment

                  Working...
                  X