TIBCO WebStudio - How does hot-deployment work for cache enabled applications part of multiple engine cluster?

TIBCO WebStudio - How does hot-deployment work for cache enabled applications part of multiple engine cluster?

book

Article ID: KB0076562

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.x

Description

Scenario:
A TIBCO BusinessEvents application is started, Cache is enabled and multiple InferenceAgents are part of the cluster, the engines are configured with external classes location using the property "be.engine.cluster.externalClasses.path". The application loads external DecisionTable (DT) class files from file system when you restart the cluster. 

Configuration need to perform hot-deployment of changes from Web Studio:

1.) Rule Management Server (RMS): RMS.cdd 

Location of external class files RMS CDD property:
ws.artifact.deploy.location=<RMSdeploymentPath-externalClassFiles>

Hot-deployment settings to trigger JMX Operation "LoadAndDeploy" in one of the InferenceAgents of the BE application
RMS CDD properties:
<application_name>.ws.applicableEnvironments=<environments>
<application_name>.<environment>.ws.jmx.hotDeploy.enable=true
<application_name>.<environment>.ws.jmx.host=<applicationhostname>
<application_name>.<environment>.ws.jmx.port=<applicationJMXPortnumber>
<application_name>.<environment>.ws.jmx.agentName=<agent-classnames>

2.) Application CDD file (Cache enabled):

CDD properties:
be.engine.cluster.externalClasses.path=<RMSdeploymentPath-externalClassFiles>/<applicationname>/Decision_Tables
be.engine.jmx.connector.port=applicationJMXPortnumber
be.engine.cluster.externalClasses.classLoader=true

Issue/Introduction

TIBCO WebStudio - WebStudio hot-deployment for applications with Cache enabled and multiple InferenceAgents configured (DecisionTable classfiles loaded from file system)

Environment

All Operating Systems

Resolution

All different scenarios for a deployed TIBCO BusinessEvents application and when it loads/updates DTs from configured external class files folder. 

1.)  Startup of BE cluster
On startup, the first agent with property be.engine.cluster.externalClasses.path defined, loads the DTs from configured external class folder. If the folder is empty or do not exist DTs are loaded from ear.
On startup of an additional agent while cache engines are running, DTs are loaded from already running cache engines and not from file system (even when be.engine.cluster.externalClasses.path is configured).


2.) WebStudio (Admin -> deploy approved changes)
When an admin user deploy updated DT, the RMS server triggers a JMX operation "LoadAndDeploy" on the configured InferenceAgent. That agent updates the DTs loaded in Cache. 
All other InferenceAgents of that cluster will reload the DTs from Cache.
Below log records created in log file:
<timestamp> <agent> Info [RMI_TCP_Connection(4)-<ip>] - [runtime.service] Cluster <application> : Hot Deployment Request, Loading Class From File System
<timestamp> <agent> Info [RMI_TCP_Connection(4)-192.168.6.1] - [runtime.service] Cluster CreditCardApplication : Hot Deployment Request, Issue Reload to All Nodes
<timestamp> <agent> Info [DefaultHotDeployer.Thread.1] - [runtime.service] Cluster CreditCardApplication: Initiated Suspend Request to All Nodes
<timestamp> <agent> IA-default Info [CreditCardApplication.worker-1] - [runtime.service] Agent inference-class-3: Suspend Request
...
<timestamp> <agent> Info [AgentMgr.Thread.1] - [runtime.service] Attempting to unlock the cluster [repl-<capacitysettings>-<application>--Master] 
...
<timestamp> <agent> Info [CreditCardApplication.worker-0] - [runtime.service] Defining External Class - be.gen.<classname>
...
<timestamp> <agent> Info [AgentMgr.Thread.1] - [runtime.service] Attempting to unlock the cluster [<capacitysettings>-<application>--Master] 
<timestamp> <agent> Info [AgentMgr.Thread.1] - [runtime.service] Cluster unlocked successfully [<capacitysettings>-<application>--Master] 


3.) Restart InferenceAgents only (CacheAgent not stopped)

The InferenceAgent(s) join an existing TIBCO ActiveSpaces cluster. They load the DTs from Cache and not from external file system.  


4.) Ear file hot-deployment enabled in application CDD file (TAB ProcessUnit -> Checkbox "Hot Deploy:")

When deploy a new ear file (agent not restarted), the InferenceAgent loads the new settings from ear file.
That means, that the agent uses the DTs defined in ear file. The DTs will not reloaded from external file system or cache.
To avoid to load and uses old versions of DTs on ear file hot-deployment, it is required that the DTs in ear file are up-to-date (same version as in WebStudio deployment folder).
When this is not possible, we strongly recommend to disable ear file hot-deployment for those applications.