]
Brad Maxwell commented on WFCORE-4291:
--------------------------------------
This is more of a feature request than a fix. The not graceful startup mode option would
introduce possible race issues allowing external requests before everything is started.
As a workaround you can currently register an mbean notification
{code}
@Override
public void handleNotification(Notification notification, Object handback) {
// Make sure the Thread Context ClassLoader is correct since this is an MBean
Callback
ClassLoader previous = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(StartedNotificationListener.class.getClassLoader());
AttributeChangeNotification attributeChangeNotification =
(AttributeChangeNotification) notification;
if
("RuntimeConfigurationState".equals(attributeChangeNotification.getAttributeName()))
{
if (notification.getSequenceNumber() == 4 && callback != null) {
log.info("Invoking callback");
getManagedExecutorService().submit(new Runnable() {
public void run() {
// invoke http or other external request
}
});
}
} catch (Throwable e) {
e.printStackTrace();
} finally {
Thread.currentThread().setContextClassLoader(previous);
}
}
{code}
[1]
Restore legacy (not "graceful") startup mode
--------------------------------------------
Key: WFCORE-4291
URL:
https://issues.redhat.com/browse/WFCORE-4291
Project: WildFly Core
Issue Type: Feature Request
Components: Management
Reporter: Vladimir Grabarchuk
Assignee: Brian Stansberry
Priority: Major
Please allow a configurable legacy startup mode which was the default before WF11, when
components can service HTTP requests as soon as they are deployed, not when the container
deploys all components.
The use case for this is the following: there is a configuration service component upon
which other components depend for configuration data, requested and served via a HTTP
request. With the new "graceful startup" this scenario no longer seems possible,
as it results in read timeouts, mis-configured artifacts, and failed deployments
altogether.
If generally feasible, another value of the *--start-mode=legacy* seems appropriate to
accommodate the original (legacy) behavior.