# Streams Formatting Quick Reference
Each of the following tables represents an example of a publisher and its subscriber, which are of course, different components. This focuses on the fields that are ‘different’ for each of these TYPEs, to illustrate the relationship between `config_key`, dmaap connection object, and the generated configuration. Some notes on specific properties:
* `config_key` is an arbitrary string, chosen by the component developer. It is returned in the generated configuration where it contains specific values for the target connection
* `format`, `version`, and `type` properties in the subscriber would match these properties in the publisher
* `aaf_username` and `aaf_password` may be different between the publisher and the subscriber
### Using http
#### *Publishing Component*
| component spec | runtime platform generated config |
|----------------|-----------------------------------|
|"streams":{
"publishes":[{
"config_key":"prediction",
"format":"some-format",
"type":"http",
"version":"0.1.0"
}]
}
|"streams_publishes":{
"prediction":["10.100.1.100:32567/data"] |
#### *Subscribing Component*
| component spec | runtime platform generated config |
|----------------|-----------------------------------|
|"streams":{
"subscribes":[{
"route":"/data",
"format":"some-format",
"type":"http",
"version":"0.1.0"
}]
}
|"N/A"|
### Using Message Router
#### *Publishing Component*
Note: When deploying, this component should be deployed first so satisfy downstream dependencies. Refer to the –force option in component ‘run’ command for more information.
| component spec | Dmaap Connection Object | runtime platform generated config |
|----------------|-------------------------| --------------------------------- |
|"streams":{
"publishes":[{
"config_key":"mr_output",
"format":"some-format",
"type":"message_router",
"version":"0.1.0"
}]
} | {
"type":"message_router",
"dmaap_info": {
"topic_url": "https://we-are-message-router.us:3905/events/some-topic" }
}
*Note: For message router, this object is identical for the publisher and the subscriber* | "streams_publishes":{
"mr_output":{
"aaf_username":"pub-user",
"aaf_password":"pub-pwd",
"type":"message_router",
"dmaap_info":{
"topic_url":"https://we-are-message-router.us:3905/events/some-topic"}
}
},
"streams_subscribes":{
…
}
#### *Subscribing Component*
| component spec | Dmaap Connection Object | runtime platform generated config |
|----------------|-------------------------| --------------------------------- |
|"streams":{
"subscribes":[{
"config_key":"mr_input",
"format":"some-format",
"type":"message_router",
"version":"0.1.0"
}]
} | {
"type":"message_router",
"dmaap_info": {
"topic_url": "https://we-are-message-router.us:3905/events/some-topic" }
}
*Note: For message router, this object is identical for the publisher and the subscriber* | "streams_publishes":{
…
},
"streams_subscribes":{
"mr_input":{
"aaf_username":"sub-user",
"aaf_password":"sub-pwd",
"type":"message_router",
"dmaap_info":{
"topic_url":"https://we-are-message-router.us:3905/events/some-topic"}
}
}
### Using Data Router
#### *Publishing Component*
| component spec | Dmaap Connection Object | runtime platform generated config |
|----------------|-------------------------| --------------------------------- |
|"streams":{
"publishes":[{
"config_key":"dr_output",
"format":"some-format",
"type":"data_router",
"version":"0.1.0"
}]
} | {
"type":"data_router",
"dmaap_info": {
"location": "mtc00",
"publish_url": "https://we-are-data-router.us/feed/xyz",
"log_url": "https://we-are-data-router.us/feed/xyz/logs",
"username": "pub-user",
"password": "pub-password",
"publisher_id": "123456"}
} | streams_publishes":{
"dr_output":{
"type":"data_router",
"dmaap_info":{
"location":"mtc00",
"publish_url":"https://we-are-data-router.us/feed/xyz",
"log_url":"https://we-are-data-router.us/feed/xyz/logs",
"username":"pub-user",
"password":"pub-password",
"publisher_id":"123456"}
}
},
"streams_subscribes":{
…
}
#### *Subscribing Component*
| component spec | Dmaap Connection Object | runtime platform generated config |
|----------------|-------------------------| --------------------------------- |
|"streams":{
"subscribes":[{
"config_key":"dr_input",
"format":"some-format",
"type":"data_router",
"version":"0.1.0",
"route":"/target-path"
}]
} | {
"type":"data_router",
"dmaap_info": {
"location": "mtc00",
"delivery_url": "https://my-subscriber-app.dcae:8080/target-path",
"username": "sub-user",
"password": "sub-password",
"subscriber_id": "789012"}
} | "streams_publishes":{
…
},
"streams_subscribes":{
"dr_input":{
"type":"data_router",
"dmaap_info":{
"location":"mtc00",
"delivery_url":"https://my-subscriber-app.dcae:8080/target-path",
"username":"sub-user",
"password":"sub-password",
"subscriber_id":"789012"}
}
}