The system administrator can enable or disable AMQP notification messages for events in a cloud. The system administrator can also configure settings that the vCloud Director AMQP service uses when it sends messages generated by notifications and blocking tasks.

AMQP broker settings are established when you install and configure RabbitMQ or another AMQP broker to use with vCloud Director. These values include the following items:

The fully-qualified domain name of the RabbitMQ server host, for example amqp.example.com.

A username and password that are valid for authenticating with RabbitMQ.

The port at which the broker listens for messages. The default is 5672.

The RabbitMQ virtual host. The default is "/".

Note

It is a good practice to test the AMQP settings before you change the configuration. See Test AMQP Settings.

Verify that you are logged in to the vCloud API as a system administrator.

1

Retrieve the SystemSettings element.

2

Examine the response to locate the links that you can use to retrieve the system's NotificationsSettings and AmqpSettings elements.

These links have a rel attribute value of down and a type attribute value of application/vnd.vmware.admin.notificationsSettings+xml for NotificationsSettings or application/vnd.vmware.admin.amqpSettings+xml for AmqpSettings, as shown here:

<Link href="https://vcloud.example.com/api/admin/extension/settings/amqp"
   rel="down"
   type="application/vnd.vmware.admin.amqpSettings+xml"/>
3

Enable or disable notifications.

a

Retrieve the NotificationsSettings element.

Make a GET request to the href value of the application/vnd.vmware.admin.notificationsSettings+xml link.

b

Modify the value of the EnableNotifications element to enable or disable notifications.

c

Update the modified element with the new contents.

PUT the modified element to the href value of its rel="edit" link.

4

Review or modify system AMQP settings.

a

Retrieve the AmqpSettings element.

Make a GET request to the href value of the application/vnd.vmware.admin.amqpSettings+xml link described in Step 2.

b

Modify the contents of this element as necessary.

See the schema reference for details of element contents.

c

Update the modified element with the new contents.

PUT the modified element to the href value of its rel="edit" link. See Example: Update AMQP Settings

This request modifies the AMQP settings for a cloud to require the use of SSL for AMQP connections, and to change the AMQP exchange type from amq.direct to amq.fanout. RabbitMQ declares these exchange types by default. For more information, see the RabbitMQ documentation.

Request:

PUT https://vcloud.example.com/api/admin/extension/settings/amqp
Content-Type: application/vnd.vmware.admin.amqpSettings+xml
...
<?xml version="1.0" encoding="UTF-8"?>
<AmqpSettings
   xmlns="http://www.vmware.com/vcloud/extension/v1.5">
   <AmqpHost />
   <AmqpPort>5672</AmqpPort>
   <AmqpUsername>guest</AmqpUsername>
   <AmqpPassword>Pa55w0rd</AmqpPassword>
   <AmqpExchange>amq.direct</AmqpExchange>
   <AmqpVHost>/</AmqpVHost>
   <AmqpUseSSL>true</AmqpUseSSL>
</AmqpSettings>

The response includes information supplied in the request, and contains a link you can use to test the settings. The value of AmqpPassword, which you must supply when you modify AmqpSettings (even if you are not changing its value), is never returned when you retrieve AmqpSettings.

Response:

200 OK
Content-Type: application/vnd.vmware.admin.amqpSettings+xml
...
<AmqpSettings
   xmlns="http://www.vmware.com/vcloud/extension/v1.5"
   type="application/vnd.vmware.admin.amqpSettings+xml"
   href="https://vcloud.example.com/api/admin/extension/settings/amqp"
   ... >
   <vcloud:Link 
      rel="test" 
      type="application/vnd.vmware.admin.amqpSettingsTest+xml" 
      href="https://vcloud.example.com/api/admin/extension/settings/amqp/action/test"/>
   <AmqpHost />
   <AmqpPort>5672</AmqpPort>
   <AmqpUsername>guest</AmqpUsername>
   <AmqpPassword />
   <AmqpExchange>amq.direct</AmqpExchange>
   <AmqpVHost>/</AmqpVHost>
   <AmqpUseSSL>true</AmqpUseSSL>
</AmqpSettings>