How to test publishing BPM Audit Data to a Java Message Service (JMS) Topic.

How to test publishing BPM Audit Data to a Java Message Service (JMS) Topic.

book

Article ID: KB0086049

calendar_today

Updated On:

Products Versions
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) -
Not Applicable -

Description

Description:
You can configure TIBCO ActiveMatrix BPM to publish audit data to a JMS topic hosted by a TIBCO Enterprise Message Service™ (EMS) server. This KB outlines steps to be taken to test the publishing BPM Audit Data to a Java Message Service (JMS) Topic. Such a test may be needed while configuring BPM Auditing to a JMS topic.

Issue/Introduction

How to test publishing BPM Audit Data to a Java Message Service (JMS) Topic.

Resolution

In the EMS topic no messages are seen. In ec_event table the messages has been inserted correctly.

For e.g. - 
tcp://localhost:7777> show topics
                                                               All Msgs            Persistent Msgs
  Topic Name                        SNFGEIBCTM  Subs  Durs     Msgs    Size        Msgs    Size
  >                                                 ----------     0     0                0     0.0 Kb        0       0.0 Kb
  ECTopic                                       ----------     0     0                0     0.0 Kb        0       0.0 Kb
  sample                                         ----------     0     0                0     0.0 Kb        0       0.0 Kb
  topic.sample                                 ----------     0     0                0     0.0 Kb        0       0.0 Kb
  topic.sample.exported                  ----+-----     0     0                 0     0.0 Kb        0       0.0 Kb
  topic.sample.imported                  -----+----     0     0                 0     0.0 Kb        0       0.0 Kb

If there are no subscribers to "ECTopic", then EMS will discard the message. From the "show topic" output, there would be 0 messages persisted. 

Here is a simpler way to test AUDIT data publishing to a JMS topic :

1). In the <TIBCO_HOME>\ems\<version>\samples\java folder, compile the tibjmsDurableSubscriber.java as :

    $setup.bat

    javac tibjmsDurableSubscriber.java

2). Run the command:

<TIBCO_HOME>\ems\6.3\samples\java>java tibjmsDurableSubscriber -server tcp://localhost:7222 -topic ECTopicDurableSubscriber sample.

Using clientID:       null
Using Durable Name:   subscriber
Subscribing to topic: ECTopic

3). Try an audited activity, such as login to workspace will get this message :


Received message: TextMessage={ Header={ JMSMessageID={ID:EMS-SERVER.2C453BEB2C7555:1754} JMSDestination={Topic[ECTopic]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Jul 17 11:06:54 EDT 2014} JMSExpiration={0} JMSPrio
rity={4} } Properties={ } Text={<Event><correlationId/><eventTimestamp>2014-07-17T15:06:54.424Z</eventTimestamp><id>138048</id><message>Login</message><messageId>WS_SECURITY_LOGIN</messageId><priority>MEDIUM</priority><severity>AUDIT</severity><attribute><attributeId>5</attributeId><attributeName>pr
eciseCreationTime</attributeName><value>1405609614403052084</value></attribute><attribute><attributeId>13</attributeId><attributeName>principalName</attributeName><value>Clint Hill</value></attribute><attribute><attributeId>28</attributeId><attributeName>hostAddress</attributeName><value>10.97.49.35
</value></attribute><attribute><attributeId>27</attributeId><attributeName>nodeName</attributeName><value>BPMNode</value></attribute><attribute><attributeId>25</attributeId><attributeName>messageCategory</attributeName><value>SECURITY</value></attribute><attribute><attributeId>24</attributeId><attri
buteName>componentId</attributeName><value>WS</value></attribute><attribute><attributeId>62</attributeId><attributeName>managedObjectName</attributeName><value>Clint Hill</value></attribute><attribute><attributeId>20</attributeId><attributeName>principalId</attributeName><value>32028D1B-6E05-4E66-94
8A-14AFCBE7361D</value></attribute><attribute><attributeId>58</attributeId><attributeName>managedObjectId</attributeName><value>32028D1B-6E05-4E66-948A-14AFCBE7361D</value></attribute><attribute><attributeId>18</attributeId><attributeName>hostName</attributeName><value>vm-w-vinay</value></attribute>
</Event>} }

4). The tibjmsDurableSubscriber will run for ever. To quit and unsubscribe:

    a). Ctrl-C : This will stop the program but it will still be subscribed to the ECTopic and EMS will persist the message for it :
        tcp://localhost:7222> show topics
                                                                                                                                                     All Msgs            Persistent Msgs
          Topic Name                                                                                                      SNFGEIBCTM  Subs  Durs     Msgs    Size        Msgs    Size
                   >                                                                                                               ----------                 0     0        0         0.0 Kb        0     0.0 Kb
             * ECTopic                                                                                                         ----------                 1     1        2         3.1 Kb        2     3.1 Kb
   
    b). Run the following command to unsubscribe:
 
        $java tibjmsDurableSubscriber -unsubscribe
        
           This will unsubscribe from ECTopic :
       
        tcp://localhost:7222> show topics
                                                                                                                                             All Msgs            Persistent Msgs
            Topic Name                                                                                                      SNFGEIBCTM  Subs  Durs     Msgs    Size        Msgs    Size
                   >                                                                                                               ----------                 0     0           0       0.0 Kb        0       0.0Kb
             * ECTopic                                                                                                         ----------                 0     0           0       0.0 Kb        0       0.0Kb

Additional Information

https://docs.tibco.com/pub/activematrix_bpm/2.2.0_september_2013/doc/html/BPM%20Administration/properties.05.14.htm
https://docs.tibco.com/pub/activematrix_bpm/2.2.0_september_2013/doc/html/BPM%20Administration/Audit.07.1.htm#1888631