Results 1 to 9 of 9

Thread: Running inbound channel adapters on HA-cluster architecture

  1. #1
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Angry 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,854

    Default

    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

  3. #3
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    Quote 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

  4. #4
    Join Date
    Dec 2010
    Posts
    315

    Default

    Quote 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

  5. #5
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    Quote Originally Posted by skram View Post
    Thanks a lot.

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

  6. #6
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    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?

  7. #7
    Join Date
    Oct 2008
    Location
    Warsaw, Poland
    Posts
    124

    Default

    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.

  8. #8
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    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.

  9. #9
    Join Date
    Jun 2011
    Location
    Sydney, Australia
    Posts
    32

    Default

    Hi,

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

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •