Ralph Knag | d2cd31b | 2018-04-02 16:27:46 -0400 | [diff] [blame^] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License.
|
| 2 | .. http://creativecommons.org/licenses/by/4.0
|
| 3 |
|
| 4 | .. _dmaap-connection-objects:
|
| 5 |
|
| 6 | DMaaP connection objects
|
| 7 | ========================
|
| 8 |
|
| 9 | DMaaP Connection Objects are JSON objects that:
|
| 10 |
|
| 11 | 1. At Runtime - this is generated by the DCAE Platform and passed to the
|
| 12 | component in its application_configuration to be used to connect to
|
| 13 | the DMaaP feed or topic. Components will receive the entire object
|
| 14 | with all properties populated (default will be \`null) unless
|
| 15 | specified otherwise.
|
| 16 | 2. During dcae_cli testing - this is provided through the command-line
|
| 17 | argument ``--dmaap-file`` to test the component with manually
|
| 18 | provisioned feeds and topics. Developers are not required to provide
|
| 19 | the entire object. The required properties are labeled below with
|
| 20 | “*Required as input*”.
|
| 21 |
|
| 22 | .. _dmaap-message-router:
|
| 23 |
|
| 24 | Message Router
|
| 25 | --------------
|
| 26 |
|
| 27 | Publishers and subscribers have the same generated
|
| 28 | ``Dmaap Connection Object`` structure. Here’s an example for any given
|
| 29 | config-key: (This is what will be in application_configuration)
|
| 30 |
|
| 31 | .. code:: json
|
| 32 |
|
| 33 | {
|
| 34 | "type": "message_router",
|
| 35 | "aaf_username": "some-user",
|
| 36 | "aaf_password": "some-password",
|
| 37 | "dmaap_info": {
|
| 38 | "client_role": "com.dcae.member",
|
| 39 | "client_id": "1500462518108",
|
| 40 | "location": "mtc00",
|
| 41 | "topic_url": "https://we-are-message-router.us:3905/events/some-topic"
|
| 42 | }
|
| 43 | }
|
| 44 |
|
| 45 | At the top-level:
|
| 46 |
|
| 47 | +--------------------------------+---------+---------------------------+
|
| 48 | | Property Name | Type | Description |
|
| 49 | +================================+=========+===========================+
|
| 50 | | type | string | *Required as input*. Must |
|
| 51 | | | | be ``message_router`` for |
|
| 52 | | | | message router topics |
|
| 53 | +--------------------------------+---------+---------------------------+
|
| 54 | | aaf_username | string | AAF username message |
|
| 55 | | | | router clients use to |
|
| 56 | | | | authenticate with secure |
|
| 57 | | | | topics |
|
| 58 | +--------------------------------+---------+---------------------------+
|
| 59 | | aaf_password | string | AAF password message |
|
| 60 | | | | router clients use to |
|
| 61 | | | | authenticate with secure |
|
| 62 | | | | topics |
|
| 63 | +--------------------------------+---------+---------------------------+
|
| 64 | | dmaap_info | JSON | *Required as input*. |
|
| 65 | | | object | Contains the topic |
|
| 66 | | | | connection details |
|
| 67 | +--------------------------------+---------+---------------------------+
|
| 68 |
|
| 69 | The ``dmaap_info`` object contains:
|
| 70 |
|
| 71 | +--------------------------------+---------+---------------------------+
|
| 72 | | Property Name | Type | Description |
|
| 73 | +================================+=========+===========================+
|
| 74 | | client_role | string | AAF client role that’s |
|
| 75 | | | | requesting publish or |
|
| 76 | | | | subscribe access to the |
|
| 77 | | | | topic |
|
| 78 | +--------------------------------+---------+---------------------------+
|
| 79 | | client_id | string | Client id for given AAF |
|
| 80 | | | | client |
|
| 81 | +--------------------------------+---------+---------------------------+
|
| 82 | | location | string | DCAE location for the |
|
| 83 | | | | publisher or subscriber, |
|
| 84 | | | | used to set up routing |
|
| 85 | +--------------------------------+---------+---------------------------+
|
| 86 | | topic_url | string | *Required as input*. URL |
|
| 87 | | | | for accessing the topic |
|
| 88 | | | | to publish or receive |
|
| 89 | | | | events |
|
| 90 | +--------------------------------+---------+---------------------------+
|
| 91 |
|
| 92 | The –dmaap-file argument (to the component ``run`` or ``dev`` command),
|
| 93 | must minimally contain:
|
| 94 |
|
| 95 | .. code:: json
|
| 96 |
|
| 97 | {
|
| 98 | "type": "message_router",
|
| 99 | "dmaap_info": {
|
| 100 | "topic_url": "https://we-are-message-router.us:3905/events/some-topic"
|
| 101 | }
|
| 102 | }
|
| 103 |
|
| 104 | .. _dmaap-data-router:
|
| 105 |
|
| 106 | Data Router
|
| 107 | -----------
|
| 108 |
|
| 109 | Publisher
|
| 110 | ~~~~~~~~~
|
| 111 |
|
| 112 | Here’s an example of what the generated ``Dmaap Connection Object`` for
|
| 113 | Data Router Publisher looks like: (This is what will be in
|
| 114 | application_configuration)
|
| 115 |
|
| 116 | .. code:: json
|
| 117 |
|
| 118 | {
|
| 119 | "type": "data_router",
|
| 120 | "dmaap_info": {
|
| 121 | "location": "mtc00",
|
| 122 | "publish_url": "https://we-are-data-router.us/feed/xyz",
|
| 123 | "log_url": "https://we-are-data-router.us/feed/xyz/logs",
|
| 124 | "username": "some-user",
|
| 125 | "password": "some-password",
|
| 126 | "publisher_id": "123456"
|
| 127 | }
|
| 128 | }
|
| 129 |
|
| 130 | At the top-level:
|
| 131 |
|
| 132 | +--------------------------------+---------+---------------------------+
|
| 133 | | Property Name | Type | Description |
|
| 134 | +================================+=========+===========================+
|
| 135 | | type | string | *Required as input*. Must |
|
| 136 | | | | be ``data_router`` for |
|
| 137 | | | | data router feeds |
|
| 138 | +--------------------------------+---------+---------------------------+
|
| 139 | | dmaap_info | JSON | *Required as input*. |
|
| 140 | | | object | Contains the feed |
|
| 141 | | | | connection details |
|
| 142 | +--------------------------------+---------+---------------------------+
|
| 143 |
|
| 144 | The ``dmaap_info`` object contains:
|
| 145 |
|
| 146 | +--------------------------------+---------+---------------------------+
|
| 147 | | Property Name | Type | Description |
|
| 148 | +================================+=========+===========================+
|
| 149 | | location | string | DCAE location for the |
|
| 150 | | | | publisher, used to set up |
|
| 151 | | | | routing |
|
| 152 | +--------------------------------+---------+---------------------------+
|
| 153 | | publish_url | string | *Required as input*. URL |
|
| 154 | | | | to which the publisher |
|
| 155 | | | | makes Data Router publish |
|
| 156 | | | | requests |
|
| 157 | +--------------------------------+---------+---------------------------+
|
| 158 | | log_url | string | URL from which log data |
|
| 159 | | | | for the feed can be |
|
| 160 | | | | obtained |
|
| 161 | +--------------------------------+---------+---------------------------+
|
| 162 | | username | string | Username the publisher |
|
| 163 | | | | uses to authenticate to |
|
| 164 | | | | Data Router |
|
| 165 | +--------------------------------+---------+---------------------------+
|
| 166 | | password | string | Password the publisher |
|
| 167 | | | | uses to authenticate to |
|
| 168 | | | | Data Router |
|
| 169 | +--------------------------------+---------+---------------------------+
|
| 170 | | publisher_id | string | Publisher id in Data |
|
| 171 | | | | Router |
|
| 172 | +--------------------------------+---------+---------------------------+
|
| 173 |
|
| 174 | The –dmaap-file argument (to the component ``run`` or ``dev`` command),
|
| 175 | must minimally contain:
|
| 176 |
|
| 177 | .. code:: json
|
| 178 |
|
| 179 | {
|
| 180 | "type": "data_router",
|
| 181 | "dmaap_info": {
|
| 182 | "publish_url": "https://we-are-data-router.us/feed/xyz"
|
| 183 | }
|
| 184 | }
|
| 185 |
|
| 186 | Subscriber
|
| 187 | ~~~~~~~~~~
|
| 188 |
|
| 189 | Here’s an example of what the generated ``Dmaap Connection Object`` for
|
| 190 | a Data Router Subscriber looks like: (This is what will be passed in
|
| 191 | application_configuration)
|
| 192 |
|
| 193 | .. code:: json
|
| 194 |
|
| 195 | {
|
| 196 | "type": "data_router",
|
| 197 | "dmaap_info": {
|
| 198 | "location": "mtc00",
|
| 199 | "delivery_url": "https://my-subscriber-app.dcae:8080/target-path",
|
| 200 | "username": "some-user",
|
| 201 | "password": "some-password",
|
| 202 | "subscriber_id": "789012"
|
| 203 | }
|
| 204 | }
|
| 205 |
|
| 206 | At the top-level:
|
| 207 |
|
| 208 | +--------------------------------+---------+---------------------------+
|
| 209 | | Property Name | Type | Description |
|
| 210 | +================================+=========+===========================+
|
| 211 | | type | string | *Required as input*. Must |
|
| 212 | | | | be ``data_router`` for |
|
| 213 | | | | data router feeds |
|
| 214 | +--------------------------------+---------+---------------------------+
|
| 215 | | dmaap_info | JSON | *Required as input*. |
|
| 216 | | | object | Contains the feed |
|
| 217 | | | | connection details |
|
| 218 | +--------------------------------+---------+---------------------------+
|
| 219 |
|
| 220 | The ``dmaap_info`` object contains:
|
| 221 |
|
| 222 | +--------------------------------+---------+---------------------------+
|
| 223 | | Property Name | Type | Description |
|
| 224 | +================================+=========+===========================+
|
| 225 | | location | string | DCAE location for the |
|
| 226 | | | | subscriber, used to set |
|
| 227 | | | | up routing |
|
| 228 | +--------------------------------+---------+---------------------------+
|
| 229 | | delivery_url | string | URL to which the Data |
|
| 230 | | | | Router should deliver |
|
| 231 | | | | files |
|
| 232 | +--------------------------------+---------+---------------------------+
|
| 233 | | username | string | Username Data Router uses |
|
| 234 | | | | to authenticate to the |
|
| 235 | | | | subscriber when |
|
| 236 | | | | delivering files |
|
| 237 | +--------------------------------+---------+---------------------------+
|
| 238 | | password | string | Password Data Router uses |
|
| 239 | | | | to authenticate to the |
|
| 240 | | | | subscriber when |
|
| 241 | | | | delivering files |
|
| 242 | +--------------------------------+---------+---------------------------+
|
| 243 | | subscriber_id | string | Subscriber id in Data |
|
| 244 | | | | Router |
|
| 245 | +--------------------------------+---------+---------------------------+
|
| 246 |
|
| 247 | The –dmaap-file argument (to the component ``run`` or ``dev`` command),
|
| 248 | must minimally contain:
|
| 249 |
|
| 250 | .. code:: json
|
| 251 |
|
| 252 | {
|
| 253 | "type": "data_router",
|
| 254 | "dmaap_info": {
|
| 255 | }
|
| 256 | }
|
| 257 |
|
| 258 | It is the recommended security practice that ``username`` and
|
| 259 | ``password`` are specified. You cannot provide the ``delivery_url`` in
|
| 260 | your dmaap-file, because it’s not constructed until deployment time.
|
| 261 | Therefore, after the test deployment, go back to the Data Router Feed
|
| 262 | and provide the delivery_url (in order to start receiving the feeds).
|
| 263 |
|
| 264 | Data Router Example
|
| 265 | ~~~~~~~~~~~~~~~~~~~
|
| 266 |
|
| 267 | (After the Data Router feed has been manually provisioned)
|
| 268 |
|
| 269 | ::
|
| 270 |
|
| 271 | $ dcae_cli component run --dmaap-file $dmaap_file $component-name
|
| 272 | DCAE.Run | WARNING | Your component is a data router subscriber. Here are the delivery urls:
|
| 273 |
|
| 274 | some-sub-dr: http://135.205.226.128:32838/identity
|
| 275 |
|
| 276 | (Update the Data Router Feed to provide the delivery_url).
|