forked from jasonkeene/docs-rabbitmq-staging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreference.html.md.erb
99 lines (84 loc) · 4.73 KB
/
reference.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
breadcrumb: VMware RabbitMQ for Tanzu Application Service Documentation
title: RabbitMQ Environment Variables
owner: London Services
---
This topic provides a reference for the environment variables that <%= vars.app_runtime_full %>
stores for <%= vars.product_full %> service instances.
These variables include the credentials that apps use to access the service instances.
## <a id='vcap-services'></a>VCAP_SERVICES
Apps running in <%= vars.app_runtime_abbr %> gain access to the bound service instances
through an environment variable credentials hash called `VCAP_SERVICES`.
An example hash is show below:
```json
{
"p.rabbitmq": [{
"label": "p.rabbitmq",
"name": "my-rabbit-service-instance",
"plan": "single-node",
"tags": ["rabbitmq"],
"credentials": {
"dashboard_url": "http://pivotal-rabbitmq.your.pcf.example.com",
"username": "b5d0ad14-4352-48e8-8982-d5b1d257029f",
"vhost": "62e5ab21-7b38-44ac-b139-6aa97af01cd7",
"password": "#passwordexample123456789",
"ssl": false,
"hostname": "q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh",
"hostnames": [
"q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh",
],
"uri": "amqp://b5d0ad14-4352-48e8-8982-d5b1d257029f:tavk86pnnns1ddiqpsdtbchurn@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh/62e5ab21-7b38-44ac-b139-6aa97af01cd7",
"uris": [
"amqp://b5d0ad14-4352-48e8-8982-d5b1d257029f:tavk86pnnns1ddiqpsdtbchurn@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh/62e5ab21-7b38-44ac-b139-6aa97af01cd7",
],
"http_api_uri": "http://b5d0ad14-4352-48e8-8982-d5b1d257029f:tavk86pnnns1ddiqpsdtbchurn@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh:15672/api",
"http_api_uris": [
"http://b5d0ad14-4352-48e8-8982-d5b1d257029f:tavk86pnnns1ddiqpsdtbchurn@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh:15672/api",
],
"protocols": {
"amqp": {
"password": "passwordexample123456789",
"port": 5672,
"ssl": false,
"username": "b5d0ad14-4352-48e8-8982-d5b1d257029f",
"vhost": "62e5ab21-7b38-44ac-b139-6aa97af01cd7",
"host": "q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh",
"hosts": [
"q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh",
],
"uri": "amqp://b5d0ad14-4352-48e8-8982-d5b1d257029f:passwordexample123456789@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh:5672/62e5ab21-7b38-44ac-b139-6aa97af01cd7",
"uris": [
"amqp://b5d0ad14-4352-48e8-8982-d5b1d257029f:passwordexample123456789@q-s0.rabbitmq-server.services-subnet.service-instance-e0e7fc5f-c1c7-4211-81b9-284fb29ba851.bosh:5672/62e5ab21-7b38-44ac-b139-6aa97af01cd7",
]
}
}
}
}]
}
```
You can search for your service by its `name`, given when creating the service instance,
or dynamically through the `tags` or `label` properties.
You can use the `credentials` property as follows:
* The top level properties `uri`, `uris`, `vhost`, `username`, `password`, `hostname`, and `hostnames` provide access to the AMQP 0.9.1 protocol.
* The `credentials.protocols` property has a key per enabled protocol, providing a more flexible
approach. The possible keys are `amqp`, `management`, `mqtt`, and `stomp`.
If SSL is enabled, the keys are `amqp+ssl`, `management+ssl`, `mqtt+ssl`, and `stomp+ssl`
respectively.
* The values associated with each of these keys gives access credentials specific to each protocol.
In all cases, URIs are provided, along with the individual components.
## <a id='plugins-protocols'></a>Changing Enabled Plugins and Protocols
<p class="note">
<strong>Note:</strong> Removing or adding plugins or protocols might cause apps bound with
<%= vars.product_short %> to break.
</p>
If you adjust the plugins and protocols enabled for RabbitMQ, you might need to force the
`VCAP_SERVICES` environment variables of all apps to be regenerated.
Adding and removing the following plugins require bound apps to be restaged:
* rabbitmq_management
* rabbitmq_stomp
* rabbitmq_web_stomp
* rabbitmq_mqtt
* rabbitmq_amqp1_0
In common with all services in <%= vars.app_runtime_abbr %>, the `VCAP_SERVICES` environment variable
for an app is only modified when the app is bound to a service instance.
Users need to `cf unbind-service`, `cf bind-service`, and `cf restage` their app in this scenario.