Solace Messaging for Pivotal Cloud Foundry® documentation
VCAP_SERVICES
Applications running in Cloud Foundry gain access to the bound service instances via credentials stored in an environment variable called VCAP_SERVICES. This environment variable is a JSON document like the example shown below:
{
"VCAP_SERVICES": {
"solace-messaging": [ {
"name": "solmessaging-shared-instance",
"label": "solace-messaging",
"plan": "VMR-shared",
"tags": [
"solace",
"rest",
"mqtt",
"mq",
"queue",
"event-streaming",
"amqp",
"jms",
"messaging",
"publish-subscribe",
"message-queuing",
"request-reply"],
"credentials": {
"clientUsername": "v005.cu000001",
"clientPassword": "bb90fcb0-6c83-4a10-bafa-3ec225bbfc08",
"msgVpnName": "v005",
"jmsJndiTlsUri": "smfs://192.168.132.14:7001",
"jmsJndiUri": "smf://192.168.132.14:7000",
"managementHttpUris": ["http://192.168.132.14:8080/SEMP/v2"],
"managementHttpsUris": ["https://192.168.132.14:443/SEMP/v2"],
"managementPassword": "e4997de2-167b-401f-affd-3721e76ff88a",
"managementUsername": "v005-mgmt",
"mqttTlsUris": ["ssl://192.168.132.14:7027"],
"mqttUris": ["tcp://192.168.132.14:7026"],
"mqttWsUris": ["ws://192.168.132.14:7028"],
"mqttWssUris": ["wss://192.168.132.14:7029"],
"restUris": ["http://192.168.132.14:7024"],
"restTlsUris": ["https://192.168.132.14:7025"],
"smfTlsHost": "tcps://192.168.132.14:7001",
"smfHost": "tcp://192.168.132.14:7000",
"smfZipHost": "tcp://192.168.132.14:7002",
"webMessagingUri": "http://192.168.132.14:7004/solace/smf"
}
}
]
}
}
Note that VCAP_SERVICES in practice is likely to contain more than one service binding. It is thus necessary to
search for the service instances in VCAP_SERVICE. This can be done statically by looking up a pre-defined name
attribute or dynamically via the tags
or label
properties. Consult the
sample application for further details on
how to achieve this.
Credentials Fields
Field | Applies to messaging protocol | Description |
---|---|---|
clientUsername | All except management (SEMP) | The client username used to access the messaging services |
clientPassword | All except management (SEMP) | The client password used to access the messaging services |
msgVpnName | JMS, SMF and webMessaging | The name of the VPN allocated to the application |
jmsJndiUri | JMS | The JNDI provider URL (InitialContext.PROVIDER_URL) |
jmsJndiTlsUri | JMS | The JNDI provider URL (InitialContext.PROVIDER_URL) |
mqttUris | MQTT | The MQTT service URIs |
mqttTlsUris | MQTT | The MQTT service TLS URIs |
mqttWsUris | MQTT | The MQTT WebSocket URIs |
mqttWssUris | MQTT | The MQTT WebSocket TLS URIs |
restUris | REST | The REST endpoints base URIs |
restTlsUris | REST | The REST TLS endpoints base URIs |
smfHost | SMF | The SMF HOST Session Property |
smfTlsHost | SMF | The SMF TLS HOST Session Property |
smfZipHost | SMF | The compressed SMF HOST Session Property |
webMessagingUri | Web Messaging | The URL used to connect the session (solclientjs and solclientas), or the HOST Session Property (CCSMP, .NET API and JAVA RTO) |
managementHttpUris | Management (SEMP) | The HTTP URIs to connect to the management service |
managementHttpsUris | Management (SEMP) | The HTTPS URIs to connect to the management service |
managementPassword | Management (SEMP) | The VPN’s administrative username |
managementUsername | Management (SEMP) | The VPN’s administrative password |
Usernames and passwords
The credentials required by the various messaging protocols are provided by clientUsername
and clientPassword
.
The credentials required to manage the VPN are provided by managementUsername
and managementPassword
.
Messaging Protocols
The messaging protocols supported are :
- JMS - Oracle’s JMS Overview
- MQTT - MQTT.orq
- SMF - Solace`s proprietary messaging protocol : See Solace Messaging API Documentation
- Web Messaging (SMF over HTTP)
- REST - Solace Open APIs Documentation
The application needs to provide the Message VPN when using the SMF
, JMS
or Web Messaging
protocols. Hence the
application needs to read the msgVpnName
fields when using those protocols.
The table above lists which fields are of interests given a protocol. There are multiple possible underlying transports for each protocol. The application will only need one Host or Uri field in order to connect, which one it needs depends on the protocol & transport combo that is required.
The prefix specifies which protocol the connection field is for, while the infix (The middle part) specifies which transport is underlying the protocol. These are the list of infix:
- Tls : TLS-encrypted
- Ws : Web Socket
- Wss : TLS-encrypted WebSocket
- Http : Plain-text HTTP
- Https : TLS HTTP
- Zip : Compressed SMF (SMF with compression enabled)
For example, an application that wants to use JMS clear text will need to read the following fields :
- clientUsername
- clientPassword
- msgVpnName
- jmsJndiUri
Management Protocol
The management protocol supported is SEMP
(Solace`s proprietary management protocol) and an application that wants to
use it will need to read the following fields:
- managementUsername
- managementPassword
- Either managementHttpUris or managementHttpsUris