Java – the order of deployment in Wildfly

javajbosswildfly8

I have a large number of services, and a core set of services that are expected to load first so that they are available when the other services load.

Does Wildfly have a specific order (e.g. alphabetical, based on filename) that it uses when doing deployments? Or is there a way to set this up?

We've tried adding code to retry connections if the other services aren't ready yet, but that involved threads, and sometimes the threads didn't get terminated properly when stuff was undeployed.

Some things that don't work for me:

Best Answer

Wildfly (Since AS7) tries to do parallel deployments to speed up the process, if you want do sequential deployment then you can provide dependencies of each deployment on another (like links you have provided in the question).

Alternatively you can use the Management CLI to order your deployment schedule, using the Batch features to ensure that your deployments occur in the order scripted, and If at least one of the commands or operations fails, all the other successfully executed commands and operations in the batch are rolled back.

See also:

Related Topic