Build a Distribution Path using JSON

In a previous post, I showed you how to build an Integrated Extract (IE) using JSON and simple cURL command. In this post, let’s take a look at how to build a Distribution Service Path.

First think to understand is that the Distribution Service is the replace for the Extract Data Pump in the traditional Oracle GoldenGate architecture. The Distribution Service does the same thing as the Extract Data Pump with the exception of transformations. If you have a need to do transformations with Oracle GoldenGate Microservices; the transformations have to be pushed to either the extract or the replicat to be done.

The purpose of the Distribution Service is to ensure that the local trail files are shipped across the network and reach the Reciever Service which will create the remote trail files.

Note: The Receiver Service, on the target side, will be started automatically when the Distribution Service connects to the port number for it.

Within the Distribution Service, you will create Distribution Paths between the source and target hosts. The way you do this with JSON quite simple. There are 4 main items the JSON should contain.

1. Name – This is what the Distribution Path will be named
2. Status – Should the Distribution Path be running or stopped
3. Source – This specifies the local trail file that should be read for transactions
4. Target – This specifies the Login and URL to write to the remote trail files.

Note: For the Target setting, there are 4 protocols that can be used:
Secure Websockets (wss) – default
Websockets (ws)
UDP-based Data Transfer Protocol (udt)
Oracle GoldenGate (ogg)

An example of a JSON document that would be used to build a Distribution Path is as follows:

{
“name”: “TSTPATH”,
“status”: “stopped”,
“source”: {
“uri”: “trail://localhost:16002/services/v2/sources?trail=bb”
},
“target”: {
“uri”: “ws://OracleGoldenGate+WSTARGET@localhost:17003/services/v2/targets?trail=bc”
}
}

To build this Distirbution Path (TSTPATH), a cURL command as such can be used to build it:

curl -X POST \
http://localhost:16002/services/v2/sources/TSTPATH \
-H ‘Cache-Control: no-cache’ \
-d ‘{
“name”: “TSTPATH”,
“status”: “stopped”,
“source”: {
“uri”: “trail://localhost:16002/services/v2/sources?trail=bb”
},
“target”: {
“uri”: “ws://OracleGoldenGate+WSTARGET@localhost:17003/services/v2/targets?trail=bc”
}
}’

Once the Distribution Path is created, you can start it. Upon starting the path, you can check the Receiver Service on the target side. It should have been started as well.

Enjoy!!!

Please follow and like:
Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Enquire now

Give us a call or fill in the form below and we will contact you. We endeavor to answer all inquiries within 24 hours on business days.