Getting Started with Predix Message Queue
Creating a Predix Message Queue Service Instance
About This Task
Procedure
Retrieving Predix Message Queue Environment Variables
About This Task
VCAP_SERVICES
. This should contain everything that you need to know to interact with service instance. You can view the contents of the VCAP_SERVICES
variable for a given app using the cf env command. Here's an example:Procedure
Example of
VCAP_SERVICES
{
"VCAP_SERVICES": {
"predix-message-queue": [
{
"credentials": {
"dashboard_url": "https://rabbitmq-8b12ecb4-0edc-451b-8c1d-d9c525b42a9d.run.aws-usw02-sb.ice.predix.io/#/login/8b12ecb4-0edc-451b-8c1d-d9c525b42a9d/Dm9eDcpWasaGOtHWESkCXg",
"hostname": "10.72.74.45",
"hostnames": [
"10.72.74.45"
],
"http_api_uri": "https://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:Dm9eDcpWasaGOtHWESkCXg@rabbitmq-8b12ecb4-0edc-451b-8c1d-d9c525b42a9d.run.aws-usw02-sb.ice.predix.io/api/",
"http_api_uris": [
"https://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:Dm9eDcpWasaGOtHWESkCXg@rabbitmq-8b12ecb4-0edc-451b-8c1d-d9c525b42a9d.run.aws-usw02-sb.ice.predix.io/api/"
],
"password": "Dm9eDcpWasaGOtHWESkCXg",
"protocols": {
"amqp": {
"host": "10.72.74.45",
"hosts": [
"10.72.74.45"
],
"password": "Dm9eDcpWasaGOtHWESkCXg",
"port": 5672,
"ssl": false,
"uri": "amqp://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]:5672/8b12ecb4-0edc-451b-8c1d-d9c525b42a9d",
"uris": [
"amqp://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]:5672"
],
"username": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d",
"vhost": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d"
},
"management": {
"host": "10.72.74.45",
"hosts": [
"10.72.74.45"
],
"password": "Dm9eDcpWasaGOtHWESkCXg",
"path": "/api/",
"port": 15672,
"ssl": false,
"uri": "http://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]:15672/api/",
"uris": [
"http://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]:15672"
],
"username": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d",
"vhost": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d"
}
},
"ssl": false,
"uri": "amqp://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]/8b12ecb4-0edc-451b-8c1d-d9c525b42a9d",
"uris": [
"amqp://8b12ecb4-0edc-451b-8c1d-d9c525b42a9d:[email protected]/8b12ecb4-0edc-451b-8c1d-d9c525b42a9d"
],
"username": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d",
"vhost": "8b12ecb4-0edc-451b-8c1d-d9c525b42a9d"
},
"label": "predix-message-queue",
"name": "my-predix-message-queue",
"plan": "Dedicated-1-Q20",
"provider": null,
"syslog_drain_url": null,
"tags": [
"rabbitmq"
],
"volume_mounts": []
}
]
}
}
The
predix-message-queue
key at the root of the VCAP_SERVICES
json should contain a list of all bound Predix Message Queue services for the app. Within that key is all of the information necessary to interact with the service. VCAP Services Key-Value Pair Definitions
VCAP Key-Value Pairs
This section describes each key in the VCAP_SERVICES
JSON for the Predix Message Queue service and its purpose.
VCAP Key | Value Definition |
---|---|
label: | The name of the Cloud Foundry service this instance belongs to, in this case predix-message-queue. |
name: | The name of the service instance. |
plan: | The service plan for the instance. |
provider: | Not used for this service. |
syslog_drain_url: | Syslog URL for logging services. Not used for RabbitMQ. |
tags: | List of tags about the type of service. Can be used for identifying the type of an attached service. |
volume_mounts: | Metadata about attached storage volumes. Not used for this service. |
Credentials Keys
The credentials
key contains the information necessary to connect and authenticate to the Predix Message Queue service.
Credential Key | Value Definition |
---|---|
dashboard_url : | The URL to the RabbitMQ web management interface. |
hostname : | The hostname or IP address of the primary RabbitMQ service node. |
| A list of hostnames or URLs for all of the nodes in the RabbitMQ cluster. |
| The URI for the RabbitMQ HTTP API. |
| A list of URIs for the HTTP management API. |
| The password for the service's RabbitMQ user account |
Protocols Keys
Protocols are specified as a subsection of Credentials key. The protocol
keys provide all of the necessary details for connecting to the service with various protocols
Protocol Key | Value Definition |
---|---|
| Credentials (host, username, password, vhost, uri etc) necessary for creating AMQP connections to the service. |
management : | Credentials for the RabbitMQ management API. |