Subscribe to Changes

Topics:

Use the following REST call to subscribe to changes for a specific subject instance or master. The payload sent to the destination will be the OID that has been modified.

POST: /server/api/v1/server/cdc/subscribe

Topics:

The data body is the configuration information about where to publish, the subscriber and optional the source to watch.

<SubscriptionConfiguration>
     <subject/>
     <source/>
     <subscriber/>
     <connectionType/>
     <url/>
</SubscriptionConfiguration>
  • subject – Required subject to subscribe to. This may be an instance or master subject.
  • source – Optional source when subscribing to instance changes.
  • subscriber – Required identifier of the subscriber.
  • connectionType – Required connection type, which must be set to REST.
  • url – Required when the connectionType is REST and is used to specify the endpoint that can accept the POST operation.

Response:

A RestResponse will be returned with the <response> containing the unique subscription ID.

Example:

POST https://localhost:9514/server/api/v1/server/cdc/subscribe

Content-Type: application/xml

<SubscriptionConfiguration>
  <subject>customer</subject>
  <subscriber>Test</subscriber>
  <connectionType>rest</connectionType>     
  <url>
    https://localhost:9514/server/api/v1/server/cdc/subscribe/loopback
  </url>
</SubscriptionConfiguration>

-- response --

200 OK
Server:  Apache-Coyote/1.1
X-Application-Context:  application:9500
Content-Type:  application/xml;charset=UTF-8
Transfer-Encoding:  chunked
Date:  Thu, 03 May 2018 11:37:45 GMT
<RestResponse>
  <status>0</status>
  <statusText/>
  <responseType>java.lang.String</responseType>
  <response>271192d4-48d0-4e91-869e-dc1b477311be</response>
</RestResponse>