In this section:
Overview
DTP uses the JMS events broker to provide real-time information about events that occur in DTP. The server publishes event messages to a topic and clients can subscribe to the topics to receive these messages.
The broker manages client connectivity and message distribution with the NIO protocol (nio://). The default port is 61617 (see Configuring the JMS Events Broker Port for instructions on changing the default port). Example URI: nio://<HOSTNAME>:61617
.
All events published to the Events Broker are logged to the jms.log file. See Viewing Log Files for instructions on accessing logs.
Accessing Event Broker Topics
Choose Report Center Settings from the settings (gear icon) menu and click Event Broker in the sidebar to access the event broker interface. The interface enables you to review event broker topics.
Support for MQTT
By default, DTP is configured to use the MQTT transport connector. The transport connector is specified in the EventsConfig.xml configuration file located in the <DTP_DATA_DIR>/conf
directory:
<?xml version="1.0" encoding="UTF-8"?> <events-configuration> <transport-connector port="61617" /> <transport-connector port="1883" protocol="mqtt"/> </events-configuration>
Event Topics
The following topics are currently available for subscription.
Event Topic | Description |
---|---|
| This topic notifies subscribers about changes to analysis metadata in the Violations and Test Explorers. There are two types of messages with the corresponding
The body of the JSON messages employ the following schema: AnalysisMetadata Event Schema { "fields": [{ "newValue": "Retest", "fieldName": "action" }], "type": "test", "date": "2015-06-08T17:12:39.323+0000", "user": "admin", "ids": ["8a981276-e694-337e-b543-2187ab610c95"], eventId": 18 } |
| This topic notifies subscribers about changes to a build review in the Change Explorer. There are two types of messages with the corresponding
Each message also contains a string property 'action' that represents the type of requested action:
Messages are BuildReview Event Schema { "type": "Review", "action": "Create", "entity": { "id": "36", "baselineBuild": { "id": "BaselineBuild" }, "targetBuild": { "id": "TargetBuild" }, "name": "ReviewName", "author": "admin", "metadata": {} }, "activity": { "author": "admin", "date": "2016-12-09T18:50:11Z", "changes": { "name": "ReviewName" } } } The JSON in the message body is the same JSON that will be returned for a successful request to the corresponding See Using DTP REST APIs for more information about the REST endpoint, including how to provide REST authentication. |
DataCollector | Notifies subscribers about events created from Data Collector. There are three types of messages with the corresponding
The body of the JSON messages employ the following schema: DataCollector Event Schema { "reportFileName":"javaStaticAnalysisRun007.xml", "eventTime":"2014-07-10 16:31:04", "status":"ReceivedEvent" } For { "reportFileName": "em.xml", "eventTime": "2014-09-30 15:20:06", "status": "ProcessedEvent", "fixedViolationsCount": 0, "newViolationsCount": 391, "suppressedViolationsCount": 48, "violationsCount": 439, "runConfigurationId": "33", "runId": "580", "testConfig": { "name": "Recommended Rules", "machine": "embuilder1.parasoft.com", "user": "jenkins", "pseudoUrl": "builtin://Recommended Rules" }, "resultsSession": { "id": "1412929102566", "project": "Environment Manager", "time": "2014-09-30T14:44:46-07:00", "hasVoils":"true", "tag": "Recommended Rules", "toolId": "jtest", "toolVer": "10.0.6.201406011700", "toolName": "Parasoft Jtest", "machine": "embuilder1.parasoft.com", "lang": "en_US", "climode": "true" } } |
Project | This topic notifies subscribers about changes made to projects. DTP will publish an event each time a project is created, updated, or deleted. Messages are PrioritizationView Event Schema { "eventType":"CREATED", "project": ["id":"27","name":"Parabank"] } The JMSType values are:
Each message also contains a string property
In the following example, a message selector detects when only the "Parabank" project is updated:
Extending the Project Event Topic with the REST API You can use the For example, assume that the project ID for the updated "Parabank" project in the previous example is 27. You could apply a
See Using DTP REST APIs for more information about the REST endpoint, including how to provide REST authentication. |
Authentication for Publishing Topics
Authentication is not required to subscribe to a topic, but authentication is required to publish to a topic. You must restart DTP Server anytime you make changes to the EventsConfig.xml or eventsbeans.xml configuration file for changes to take effect.
Enabling the Authentication Topic
- Open the EventsConfig.xml configuration file located in the
<DTP_DATA_DIR>/conf
directory. - Locate the
<topic-authentication>
element and set the enabled attribute totrue
(default). Set the attribute tofalse
to disable authentication. Changing username and password is not recommended. - Restart DTP Server (see Starting DTP Applications).
Authentication Exceptions
You can control which topics do not require authentication after authentication has been enabled.
- Open the events-beans.xml configuration file located in the
<DTP_INSTALL>/tomcat/webapps/grs/WEB-INF/springs/
directory. Add topic names to the list of
nonAuthenticatedTopics
property in thedestinationAuthenticationManager
bean:<bean id="destinationAuthenticationManager"> <property name="nonAuthenticatedTopics"> <list> <value>MyTopicName</value> </list> </property> </bean>
Restart DTP Server (see Starting DTP Applications).