8. vCloud Management and Monitoring Examples : 8.3 AMQP Blocking Tasks : 8.3.2 Example
   
8.3.2 Example
In this example, the private cloud provider would like to configure approvals for the Instantiation of vApps by cloud consumers in their private clouds. When a user attempts to Instantiate a vApp from a template, vCloud Director sends a notification of the request to the appropriate AMQP exchange, and waits on acknowledgement and approval of the request before continuing.
The blocking task example configuration shown in the following figure consists of the following components:
*vCloud Director 5.1 cell (message producer).
*AMQP 0.9 or later message bus (message queue).
*AMQP client (message consumer).
*REST client or vCloud SDK.
Figure 75. AMQP Blocking Task Architecture
The producer (VCD) sends messages to the events queue. The client (consumer) receives messages from the queue. The client triggers the approval process. The result of the approval step (resume, abort, cancel) is submitted to VCD for completion of the task within VCD. At this point the task completes its processing or is terminated with the appropriate state.
There are several ways of defining the queue type based on the use case for the messages being delivered. Message queues can be defined as direct, topic, fan out, system or header.
For information on the exchange types and how to configure binding/routing of messages refer to the RabbitMQ Tutorials (http://www.rabbitmq.com/getstarted.html).