2

My Wildfly 8 domain has two hosts Master and Slave. I need to start my application only on one node at a time. Do I need to implement org.jboss.msc.service.ServiceActivator for this?

I believe this ServiceActivator should be implemented in case of standalone servers only.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
akashpandey
  • 177
  • 1
  • 11

1 Answers1

0

Whenever Wildfly activates a MSC service, it notifies the class which implements ServiceActivator interface.

For your need (master/slave failover), singleton deployment (available wildfly 10 onwards) might be the right choice.

You can configure your MSC service as Singleton (across cluster) by using the SingletonPolicy.

Refer:

https://docs.jboss.org/author/display/WFLY10/Singleton+deployments

https://docs.jboss.org/author/display/WFLY10/Singleton+MSC+services

Sri
  • 4,613
  • 2
  • 39
  • 42