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.
In this section:
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_HOME]/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 TextMessage types that contain JSON as the message body. Example: 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" } } }
See REST API 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" } } |
PrioritizationView | This topic is deprecated in DTP 5.1.4 and later. If you are currently using this topic, we strongly recommend switching to the This topic notifies subscribers about violation priority changes made in the Violations Explorer. There is only one type of message, so PrioritizationView Event Schema { "eventId":"102", "violationIds": ["8f522ef1-18bf-38a9-a9ce-dfaa3c91f4f6"], } The
An array of the violation’s modification history is returned, and the eventId can be used to correlate what has changed. |
Project | This topic notifies subscribers about changes made to Project Center 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":"Parasbank"] } 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 https://yourserver:8443/grs/api/v1/projects/27 See REST API for more information about the REST endpoint, including how to provide REST authentication. |
ProjectCenter | This topic notifies subscribers about changes made to Project Center entities, including tasks, requirements, and defects. When a change is made, Project Center will publish a message that describes the details of the change for each entity directly affected. Messages are
Subscribers can use this header as part of their message selector. For example:
|
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_HOME]/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 Services).
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_HOME]/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 Services).