Skip to main content
Version: Develop

Service Instance Access

This page describes usage specific to a9s Messaging. It builds upon the information provided in Getting Started - Accessing a Service Instance.

Accessing an a9s Messaging Service Instance

In order to access an a9s Messaging Service Instance, the Service Instance's credentials stored in the environment variables of the application bound to it. This is further explanined in Lifecycle of a Service Instance - Obtain Credentials for Accessing a Service Instance.

cf env a9s-messaging-app
Output
Getting env variables for app a9s-messaging-app in org test / space test as admin...
OK

System-Provided:
{
"VCAP_SERVICES": {
"a9s-messaging313": [
{
"credentials": {
"host": "hostname.node.dcx.consul",
"hosts": [
"hostname.node.dcx.consul"
],
"password": "password",
"port": 5672,
"http_api_uri": "http://username:password@hostname.node.dcx.consul/api/",
"http_api_uris": ["http://username:password@hostname.node.dcx.consul/api/"],
"protocols": {
"amqp": {
"host": "hostname.node.dcx.consul",
"hosts": [
"hostname.node.dcx.consul"
],
"password": "password",
"port": 5672,
"ssl": false,
"uri": "amqp://username:password@hostname.node.dcx.consul:5672",
"username": "username"
},
"management": {
"username": "username",
"password": "password",
"path": "/api",
"ssl": false,
"host": "hostname.node.dcx.consul",
"hosts": [
"hostname.node.dcx.consul"
],
"uri": "http://username:password@hostname.node.dcx.consul",
"uris": ["http://username:password@hostname.node.dcx.consul"]
}
},
"ssl": false,
"uri": "username:password@hostname.node.dcx.consul:5672",
"username": "username"
},
"label": "a9s-messaging313",
"name": "a9s-messaging-app",
"plan": "messaging-single-small",
"provider": null,
"syslog_drain_url": null,
"tags": [
"messaging",
"queue"
],
"volume_mounts": []
}
]
}
}
...

The host, username and password values can be used to connect to a database with a RabbitMQ client.

Protocols Hash

The credentials hash contains a protocols hash that lists credentials by protocol. The credentials at the root level of the credentials are either for AMQP with non SSL service plans or AMQPS with SSL service plans.

Protocol keyEnabled when
amqpalways
amqp+sslSSL plan
mqttMQTT plugin enabled
mqtt+sslSSL plan and MQTT plugin enabled
webmqtt+sslSSL plan and WebMQTT plugin enabled
stompSTOMP plugin enabled
stomp+sslSSL plan and STOMP plugin enabled
webstomp+sslSSL plan and WebSTOMP plugin enabled
managementalways

Use RabbitMQ Management Dashboard

a9s Messaging has management dashboard support enabled. The dashboard is running on the Service Instance VM so it is not possible to open the dashboard in your browser directly.

Option: via (Go) router

When the Platform Operator has configured the (Go)router to route the RabbitMQ Management Dashboard the dashboard will be exposed under a URL formatted as https://service-instance-guid.a9s-rabbitmq-dashboard.system.domain.

Create a Tunnel to the Service

With the cf ssh command a ssh forward tunnel to the management dashboard can be created. Use port 15672 to connect to the a9s Search Instance.

cf ssh a9s-messaging-app -L 15672:d67901c.service.dc1.a9svs:15672
vcap@956aaf4e-6da9-4f69-4b1d-8e631a403312:~$
note

Don't forget to close the session with exit.

Login to The Management Dashboard

When the ssh tunnel is open, you can access the Dashboard with your Browser. Depending on the service plan used for your Service Instance, you have to visit one of the following URLs:

To login to the management dashboard you need the user credentials.

management-dashboard-login

If the login was successful, you should see the dashboard as followed.

management-dashboard