Which profile do you use to run wildfly? If you are adding messaging subsystem via cli, it'll require reload.
That's the thing we want to automate the process regardless of the chosen profile. We provision everything the profile needs and we're hitting a brick wall when it says it needs a reload but we can't do that because our app is already deploying
One thing that comes to mind is that you could start server in offline (admin-only) mode and than have CLI script that would
preform checks and add messaging if necessary, add deployment and on last step start server in "normal" mode.
Yeah that would be the normal flow but we are executing the CLI script from within the app that is being deployed. Currently we have alot of servers and can't go through them all to add a script by hand that will provision the jms subsystem and have someone run them before running the server.
Executing CLI script from within app that is being deployed is a risky operation in any case as deploy is blocking operation that blocks execution of all operations to the server...
Thing is also that you can add whole subsystem as part of batch operation that would add it in "single" step as such reduce few reload-required scenarios
also you should probably add allow-resource-restart header to all operations.
But even with all that I doubt messaging subsystem will add itself properly as there are few "add registrations" that systems needs to do in "performBoottime()" wildfly-core/AbstractBoottimeAddStepHandler.java at master · wildfly/wildfly-core · GitHub which is usually where subsystem registers deployment processors and such.
Yeah i have all of the adding in a single batch step so yes i have only 1 step that requires a restart. Also i have added the allow-resource-restart on all operations that required a restart header but still no luck :/
I have managed to add the reload step to the end of the batch and it works but since the reload triggers immediately i guess that the app can't figure out that the server is reloading and tries to init some things (like entity managers, resources etc) and throws a couple exceptions but then it undeploys and deploys again. Is there a way to trigger immediate undeployment or something similar ?