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
|
||||
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"
|
||||
xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler">
|
||||
|
@ -20,16 +16,6 @@
|
|||
</doCatch>
|
||||
</doTry>
|
||||
</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>
|
||||
|
||||
<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"
|
||||
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">
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" 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
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="ValidateConfigRequestHandler"
|
||||
class="com.raytheon.uf.edex.site.handlers.ValidateConfigRequestHandler" />
|
||||
|
@ -34,5 +34,24 @@
|
|||
<constructor-arg ref="getActiveSitesHandler" />
|
||||
</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>
|
||||
|
|
@ -30,7 +30,7 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification;
|
|||
import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONSTATUS;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Monitors site activation across all JVMs on all cluster members
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -38,7 +38,8 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONS
|
|||
*
|
||||
* 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>
|
||||
*
|
||||
|
@ -47,7 +48,6 @@ import com.raytheon.uf.common.site.notify.SiteActivationNotification.ACTIVATIONS
|
|||
*/
|
||||
|
||||
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>>> deactivationMap = new HashMap<String, Map<String, Set<String>>>();
|
||||
|
@ -98,7 +98,7 @@ public class SiteActivationMonitor {
|
|||
status = ACTIVATIONSTATUS.SUCCESS;
|
||||
}
|
||||
|
||||
public ACTIVATIONSTATUS getStatus(){
|
||||
public ACTIVATIONSTATUS getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ public class SiteActivationMonitor {
|
|||
deactivationMap.get(plugin).get(modifiedSite)
|
||||
.add(serverAndMode);
|
||||
}
|
||||
} else if (notification.isSuccess()) {
|
||||
} else {
|
||||
if (notification.isActivation()) {
|
||||
activationMap.get(plugin).get(modifiedSite)
|
||||
.remove(serverAndMode);
|
||||
|
@ -143,9 +143,11 @@ public class SiteActivationMonitor {
|
|||
deactivationMap.get(plugin).get(modifiedSite)
|
||||
.remove(serverAndMode);
|
||||
}
|
||||
} else if (notification.isFailure()) {
|
||||
status = ACTIVATIONSTATUS.FAILURE;
|
||||
if (notification.isFailure()) {
|
||||
status = ACTIVATIONSTATUS.FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ import java.net.UnknownHostException;
|
|||
import java.util.ArrayList;
|
||||
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.status.IUFStatusHandler;
|
||||
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;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Send site activation notifications to the SiteActivationMonitor
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -39,8 +41,10 @@ import com.raytheon.uf.edex.core.EdexException;
|
|||
*
|
||||
* 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
|
||||
* Sep 11, 2014 3622 randerso Changed to use jms topic instead of vm queue so monitor
|
||||
* sees messages from all JVMs.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -52,7 +56,7 @@ public class SendSiteActivationNotifications {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.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)
|
||||
throws EdexException {
|
||||
|
@ -70,8 +74,14 @@ public class SendSiteActivationNotifications {
|
|||
for (SiteActivationNotification notify : notifications) {
|
||||
notify.setRunMode(modeName);
|
||||
notify.setServerName(host);
|
||||
EDEXUtil.getMessageProducer().sendAsync(
|
||||
SITE_ACTIVATION_ROUTE, notify);
|
||||
try {
|
||||
EDEXUtil.getMessageProducer().sendAsyncUri(
|
||||
SITE_ACTIVATION_URI,
|
||||
SerializationUtil.transformToThrift(notify));
|
||||
} catch (SerializationException e) {
|
||||
statusHandler.error(
|
||||
"Error transforming notification to thrift", e);
|
||||
}
|
||||
}
|
||||
} catch (EdexException e) {
|
||||
statusHandler.error("Error sending gfe notification", e);
|
||||
|
|
Loading…
Add table
Reference in a new issue