Chapter 3 Cache Object Management Tutorial : Configure Inference Agents

Configure Inference Agents
Inference agents are configured partly in TIBCO Designer using a BAR resource, and partly using engine property (TRA) files. You can use a supplementary property file for each agent to make command line startup easier.
Learning Points
Inference agents  do the decisioning work. Each agent has a Rete network, for processing incoming events. You can think of an inference agent as a rule session, attached to the cluster.
Agent group  An agent group is formed by deploying one agent multiple times, generally on different machines. Use of agent groups requires the multi-engine features to be enabled (see Configure Cache Cluster Properties).
Fault tolerance and load balancing  are provided automatically when you use agent groups and multi-engine features. (Fault tolerance is also available without multi-engine). You can configure some agents to be inactive, available only for fault tolerance. However, all active agents load balance and if one agent fails, the others handle the load, so you may not need to keep an agent inactive.
To make an agent inactive, set the Agent.AgentGroupName.maxActive property to a lower number than the number of agents in the group. All deployed agents in addition to that number are inactive—which ones are inactive is specified by a priority number.
Agent group key (and scorecards)  It is a good idea to identify each agent in a group uniquely. To do so you define an agent group key property and give each agent a unique value. For example, this property is required if your project uses scorecards. Scorecard values are not shared between agents in a group. When recovering from failure, the system needs to identify which scorecard instance belongs to which agent so that the correct value is restored.
Local storage  For performance reasons, it is recommended that you disable local storage of cache data on inference agents and query agents. Instead use dedicated cache server nodes for storage of cache data. To disable local storage, set the following property set to false (it is true by default):
java.property.tangosol.coherence.distributed.localstorage=false
Task I Configure Inference Agent OM Settings in TIBCO Designer
1.
2.
Double-click the FraudDetection enterprise archive resource to open it and then double-click the FraudDetection BusinessEvents archive that is within it.
For details about basic configuration of the BAR, see Validate the Project, Configure and Build the Archive.
3.
The other option, Query, is used when configuring a query agent (available in the TIBCO BusinessEvents Enterprise Suite software).
4.
Select the Object Management tab and do the following
a.
b.
It is a recommended practice to use the BAR name as the agent group name.
Cache Modes  In the Object Management tab, different cache modes can be set on individual entities, to tune memory use and performance. See Chapter 18, Understanding and Working With Cache Modes in TIBCO BusinessEvents User’s Guide to explore cache mode features.
5.
In the Configuration tab, click Build Archive. You may be prompted to save the project. You should see the message "Enterprise Archive File has built correctly":
Task J Configure the Inference Agent Engine Properties
In this step you will create three property files, one for each inference agent.
Preconfigured files are available in BE_HOME/Examples/
1.
Open the BE_HOME/bin/agent1.tra you configured in Task G, Configure Cluster Properties.
2.

 
#### Inference Agent 1 Properties
 
java.property.tangosol.coherence.distributed.localstorage=false
Agent.FraudDetection.maxActive=2
Agent.FraudDetection.priority=1
Agent.FraudDetection.key=agent1

 
Where FraudDetection is the agent group name you assigned in the BAR resource in TIBCO Designer (see Task I, Configure Inference Agent OM Settings in TIBCO Designer).
3.
Save the file in the BE_HOME/bin directory, using the name agent1.tra.
4.
Modify the section title, and the priority and key properties as shown in the Inference Agent 2 Properties section below and save the file as BE_HOME/bin/agent2.tra:

 
####Inference Agent 2 Properties
 
java.property.tangosol.coherence.distributed.localstorage=false
Agent.FraudDetection.maxActive=2
Agent.FraudDetection.priority=2
Agent.FraudDetection.key=agent2

 
5.

 
####Inference Agent 3 Properties
 
java.property.tangosol.coherence.distributed.localstorage=false
Agent.FraudDetection.maxActive=2
Agent.FraudDetection.priority=3
Agent.FraudDetection.key=agent3