3. Triggering Workflows with vCloud Notifications : 3.3 Workflow: Create a vCloud Director notification subscription : 3.3.2 Workflow Overview
   
3.3.2 Workflow Overview
The workflow contains the following elements:
*Create Routing Key.
*Configure vCloud Director AMQP Subscription (workflow).
*Set Custom Properties.
3.3.2.1. Create Routing Key
The filter policy inputs are used to generate a routing key. Routing keys define which messages received by an exchange to route to the queue. The routing key is used when the queue is bound to the exchange. It is a required parameter for the Configure vCloud Director AMQP Subscription workflow. The vCloud notification messages routing key has the following format:
<operationSuccess>.<entityUUID>.<orgUUID>.<userUUID>.<subType1>.<subType2>...<subTypeN>.[taskName]
Depending on the chosen filter policy inputs, each segment in the routing key generated by the createRoutingKey action can include a specific type or “#” as a wild card character. For additional information on routing keys and exchange routing, see “vCloud Managing and Monitoring Examples” in Implementation Examples, and the RabbitMQ Documentation (http://www.rabbitmq.com/documentation.html).
3.3.2.2. Workflow: Configure vCloud Director AMQP Subscription
This workflow configures the AMQP server to handle a given message type.
Table 6. Workflow Steps: Configure vCloud Director AMQP Subscription
Step
Detail
1. Get the AMQP configuration.
Get the AMQP configuration from the specified vCloud Director host, including AMQP host name, port, virtual host, user name, exchange name, and SSL setting.
2. Add a broker.
Add an AMQP broker or use an existing one.
3. Declare an exchange.
Declare an exchange for the configured broker. The exchange type is topic, to match the vCloud Director routing format. New exchanges are set to be durable and to not auto-delete.
4. Declare a queue.
Declare a queue using the provided queue name. New queues are set to be durable, not exclusive, and to not auto-delete.
5. Bind.
Bind the declared queue to the exchange by providing the routing key generated from the inputted filter policy.
6. Subscribe to queues.
Allows the AMQP plug-in to receive message updates on new messages.
 
This workflow creates broker and subscription inventory objects that are saved and reloaded automatically when the vCenter Orchestrator server is restarted.
3.3.2.3. Set Custom Properties
The subscription object is set with custom properties that match all of the input parameter settings. These are used to view the properties of a subscription in a human readable form and also to pass required parameters to the workflow used by the AMQP policy.