Omaha #3622 Fix site actiavtion completion message to wait until all JVMs are done
Change-Id: I5130a548bc8ed28e507ded8ef555ae9e966ec3e2 Former-commit-id:073435a715
[formerly6a8c82891a
[formerly 5a4a1a9a377f11b78ce7a477f205d47c3d763edd]] Former-commit-id:6a8c82891a
Former-commit-id:69789ef17b
This commit is contained in:
parent
740d777efc
commit
fe938f5c94
4 changed files with 47 additions and 30 deletions
|
@ -2,10 +2,6 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="siteActivateNotifyFilter"
|
|
||||||
class="com.raytheon.uf.edex.site.notify.SiteActivateNotifyFilter" />
|
|
||||||
<bean id="siteActivationMonitor" class="com.raytheon.uf.edex.site.SiteActivationMonitor" factory-method="getInstance"/>
|
|
||||||
|
|
||||||
<camelContext id="siteActivation"
|
<camelContext id="siteActivation"
|
||||||
xmlns="http://camel.apache.org/schema/spring"
|
xmlns="http://camel.apache.org/schema/spring"
|
||||||
errorHandlerRef="errorHandler">
|
errorHandlerRef="errorHandler">
|
||||||
|
@ -20,16 +16,6 @@
|
||||||
</doCatch>
|
</doCatch>
|
||||||
</doTry>
|
</doTry>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="siteActivateNotify">
|
|
||||||
<from uri="vm:edex.siteActivateNotification?size=5000" />
|
|
||||||
<filter>
|
|
||||||
<method bean="siteActivateNotifyFilter" method="isSiteActivateNotification" />
|
|
||||||
<bean ref="siteActivationMonitor" method="handleNotification"/>
|
|
||||||
<bean ref="serializationUtil" method="transformToThrift" />
|
|
||||||
<to uri="jms-generic:topic:edex.alerts.siteActivate?timeToLive=60000" />
|
|
||||||
</filter>
|
|
||||||
</route>
|
|
||||||
</camelContext>
|
</camelContext>
|
||||||
|
|
||||||
<bean id="siteAwareRegistry" class="com.raytheon.uf.edex.site.SiteAwareRegistry" factory-method="getInstance">
|
<bean id="siteAwareRegistry" class="com.raytheon.uf.edex.site.SiteAwareRegistry" factory-method="getInstance">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||||
|
|
||||||
<bean id="ValidateConfigRequestHandler"
|
<bean id="ValidateConfigRequestHandler"
|
||||||
class="com.raytheon.uf.edex.site.handlers.ValidateConfigRequestHandler" />
|
class="com.raytheon.uf.edex.site.handlers.ValidateConfigRequestHandler" />
|
||||||
|
@ -34,5 +34,24 @@
|
||||||
<constructor-arg ref="getActiveSitesHandler" />
|
<constructor-arg ref="getActiveSitesHandler" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="siteActivateNotifyFilter"
|
||||||
|
class="com.raytheon.uf.edex.site.notify.SiteActivateNotifyFilter" />
|
||||||
|
<bean id="siteActivationMonitor" class="com.raytheon.uf.edex.site.SiteActivationMonitor" factory-method="getInstance"/>
|
||||||
|
|
||||||
|
<camelContext id="siteActivationMonitoring"
|
||||||
|
xmlns="http://camel.apache.org/schema/spring"
|
||||||
|
errorHandlerRef="errorHandler">
|
||||||
|
|
||||||
|
<route id="siteActivateNotify">
|
||||||
|
<from uri="jms-generic:topic:siteActivateNotification" />
|
||||||
|
<bean ref="serializationUtil" method="transformFromThrift"/>
|
||||||
|
<filter>
|
||||||
|
<method bean="siteActivateNotifyFilter" method="isSiteActivateNotification" />
|
||||||
|
<bean ref="siteActivationMonitor" method="handleNotification"/>
|
||||||
|
<bean ref="serializationUtil" method="transformToThrift" />
|
||||||
|
<to uri="jms-generic:topic:edex.alerts.siteActivate?timeToLive=60000" />
|
||||||
|
</filter>
|
||||||
|
</route>
|
||||||
|
</camelContext>
|
||||||
</beans>
|
</beans>
|
||||||
|
|
|
@ -30,7 +30,7 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification;
|
||||||
import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONSTATUS;
|
import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONSTATUS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Monitors site activation across all JVMs on all cluster members
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -38,7 +38,8 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONS
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 9, 2011 bphillip Initial creation
|
* Aug 09, 2011 bphillip Initial creation
|
||||||
|
* Sep 11, 2014 #3622 randerso Fixed logic so failures still remove pending requests
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -47,7 +48,6 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SiteActivationMonitor {
|
public class SiteActivationMonitor {
|
||||||
|
|
||||||
private Map<String, Map<String, Set<String>>> activationMap = new HashMap<String, Map<String, Set<String>>>();
|
private Map<String, Map<String, Set<String>>> activationMap = new HashMap<String, Map<String, Set<String>>>();
|
||||||
|
|
||||||
private Map<String, Map<String, Set<String>>> deactivationMap = new HashMap<String, Map<String, Set<String>>>();
|
private Map<String, Map<String, Set<String>>> deactivationMap = new HashMap<String, Map<String, Set<String>>>();
|
||||||
|
@ -98,7 +98,7 @@ public class SiteActivationMonitor {
|
||||||
status = ACTIVATIONSTATUS.SUCCESS;
|
status = ACTIVATIONSTATUS.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ACTIVATIONSTATUS getStatus(){
|
public ACTIVATIONSTATUS getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ public class SiteActivationMonitor {
|
||||||
deactivationMap.get(plugin).get(modifiedSite)
|
deactivationMap.get(plugin).get(modifiedSite)
|
||||||
.add(serverAndMode);
|
.add(serverAndMode);
|
||||||
}
|
}
|
||||||
} else if (notification.isSuccess()) {
|
} else {
|
||||||
if (notification.isActivation()) {
|
if (notification.isActivation()) {
|
||||||
activationMap.get(plugin).get(modifiedSite)
|
activationMap.get(plugin).get(modifiedSite)
|
||||||
.remove(serverAndMode);
|
.remove(serverAndMode);
|
||||||
|
@ -143,9 +143,11 @@ public class SiteActivationMonitor {
|
||||||
deactivationMap.get(plugin).get(modifiedSite)
|
deactivationMap.get(plugin).get(modifiedSite)
|
||||||
.remove(serverAndMode);
|
.remove(serverAndMode);
|
||||||
}
|
}
|
||||||
} else if (notification.isFailure()) {
|
if (notification.isFailure()) {
|
||||||
status = ACTIVATIONSTATUS.FAILURE;
|
status = ACTIVATIONSTATUS.FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.serialization.SerializationException;
|
||||||
|
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||||
import com.raytheon.uf.common.site.notify.SiteActivationNotification;
|
import com.raytheon.uf.common.site.notify.SiteActivationNotification;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
@ -31,7 +33,7 @@ import com.raytheon.uf.edex.core.EDEXUtil;
|
||||||
import com.raytheon.uf.edex.core.EdexException;
|
import com.raytheon.uf.edex.core.EdexException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Send site activation notifications to the SiteActivationMonitor
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -39,8 +41,10 @@ import com.raytheon.uf.edex.core.EdexException;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Aug 9, 2011 bphillip Initial creation
|
* Aug 09, 2011 bphillip Initial creation
|
||||||
* Feb 15, 2013 1638 mschenke Moved site activation notifier class into edex.site
|
* Feb 15, 2013 1638 mschenke Moved site activation notifier class into edex.site
|
||||||
|
* Sep 11, 2014 3622 randerso Changed to use jms topic instead of vm queue so monitor
|
||||||
|
* sees messages from all JVMs.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -52,7 +56,7 @@ public class SendSiteActivationNotifications {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(SendSiteActivationNotifications.class);
|
.getHandler(SendSiteActivationNotifications.class);
|
||||||
|
|
||||||
private static String SITE_ACTIVATION_ROUTE = "siteActivateNotify";
|
public static String SITE_ACTIVATION_URI = "jms-generic:topic:siteActivateNotification?timeToLive=60000";
|
||||||
|
|
||||||
public static void send(SiteActivationNotification notification)
|
public static void send(SiteActivationNotification notification)
|
||||||
throws EdexException {
|
throws EdexException {
|
||||||
|
@ -70,8 +74,14 @@ public class SendSiteActivationNotifications {
|
||||||
for (SiteActivationNotification notify : notifications) {
|
for (SiteActivationNotification notify : notifications) {
|
||||||
notify.setRunMode(modeName);
|
notify.setRunMode(modeName);
|
||||||
notify.setServerName(host);
|
notify.setServerName(host);
|
||||||
EDEXUtil.getMessageProducer().sendAsync(
|
try {
|
||||||
SITE_ACTIVATION_ROUTE, notify);
|
EDEXUtil.getMessageProducer().sendAsyncUri(
|
||||||
|
SITE_ACTIVATION_URI,
|
||||||
|
SerializationUtil.transformToThrift(notify));
|
||||||
|
} catch (SerializationException e) {
|
||||||
|
statusHandler.error(
|
||||||
|
"Error transforming notification to thrift", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (EdexException e) {
|
} catch (EdexException e) {
|
||||||
statusHandler.error("Error sending gfe notification", e);
|
statusHandler.error("Error sending gfe notification", e);
|
||||||
|
|
Loading…
Add table
Reference in a new issue