Friday 17 April 2015

TIBCO Business event & JConsole: Lets move into Business Event Engine

Most of the time while working with TIBCO Business event, developers revolve around the business logics and Business Events entities. It often happen, developers logical expectation from code don't match with actual execution. In those cases, to debug the issue developers often put "System.debugOut" where ever needed to check what when wrong, and eventually find it. 

Lets consider a scenario. We are storing some data in a concept and at certain point we need to know what data is stored or Is the rule triggered or Did the event come in or Is my destination active and many more. In general, we will go ahead, stop the engine, put some print statement, redeploy the code and check what went wrong. But, what if the code is in production environment,where redeployment is not an option? 

JConsole is the answer to this situation. we can do a lot of operations using JConsole. Few of the operations are list below.


  • View a Concept Instance in the Memory.
  1. Open JConsole.
  2. Connect to the PID which is corresponding to the inference Engine (for me it is ALERT-MANAGEMENT) not Cache engine.
  3. To check if the PID is corresponding to inference Agent,  Go to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Working Memory--> Operations --> GetRuleSession.
  4. Go to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Object management--> Operations -> GetInstance.
  5. Pass the concept ID (not ExtID) as parameter p1. keep p2 empty. click on GetInstance.
  6. Check all the parameter values of the respective instance, by changing the "Tabular navigation.


  • Get the list of Rules in the deployed Inference Engine
  1. Open JConsole and connect the PID  corresponding to required Inference engine
  2. Go to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Working Memory--> Operations --> GetRules
  3. It will show the list of all the rules in the Inference engine. Navigate through the "Tabular navigation" to go through the list of rules. It can also be found here if the rule is Active or not
  4. To get the spesific rule details. go to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Working Memory--> Operations --> GetRule. Pass p1 as <Rule_URI>  
            e.g /MyRule/Rule/AdvisoryRule.   
  • Activate And Deactivate Rule
  1. Open JConsole and connect the PID  corresponding to required Inference engineGo to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Working Memory--> Operations --> DeactivateRule
  2. Pass p1 as <Rule_URI>
    e.g /MyRule/Rule/SomeRule

    Once the rule is deactivated. It would not be triggered although the declaration and condition satisfy.
  3. Once the rule is deactivated, it can be activate again using
    MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Working Memory--> Operations --> ActivateRule 
  4. pass P1 = <Rule_URI>

  • Starting and Stoping profiler
  1. Open JConsole and connect the PID  corresponding to required Inference engine
  2. Go to MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Profiler--> Operations --> StartFileBasedProfiler
  3. Pass p1 as location of the csv file where it save the details of the execution                                  e.g c:/temp/BeProfile.csv
  4. p2 as <level>  -1 to any positive value . By default -1
    p2 as <duration>  -1 to any positive value. By default -1
  5. to stop the profiler MBeans --> com.tibco.be-->Agent-->1(any number)-->Methods-->Profiler--> Operations --> StopFileBasedProfiler
    ** two profiler cannot be started at the same time.
    ** data in the csv file can only visible after stopping the profiler

No comments:

Post a Comment