Chapter 4. Using MRG Messaging with Python

Chapter 4. Using MRG Messaging with Python

4.1. Creating and Closing Sessions
4.2. Writing Direct Applications in Python.
4.2.1. Running the Direct Examples
4.2.2. Declaring and Binding a Queue
4.2.3. Publishing Messages to a Direct Exchange
4.2.4. Reading Messages from the Queue
4.2.5. Reading Messages from a Queue using a Listener
4.3. Writing Fanout Applications in Python
4.3.1. Running the Fanout Examples
4.3.2. Consuming from a Fanout Exchange
4.3.3. Publishing Messages to the Fanout Exchange
4.4. Writing Publish/Subscribe Applications in Python
4.4.1. Running the Publish-Subscribe Examples
4.4.2. The Topic Publisher
4.4.3. The Topic Subscriber
4.5. Writing Request/Response Applications in Python
4.5.1. Running the Request/Response Examples
4.5.2. The Server Application
4.5.3. The Client Application
4.6. XML-based Routing in Python
4.6.1. Running the XML-based Routing Examples
4.6.2. Declaring an XML Exchange, Declaring and Binding a Queue
4.6.3. Publishing to an XML Exchange
4.6.4. Reading from the Message Queue
4.7. Durable Queues and Durable Messages in Python
4.8. Using Transactions in Python
4.9. Logging in Python client applications

This section shows how to write direct, fanout, publish/subscribe, request/response, and XML-based routing programs in Python. These concepts are explained in Chapter 2, Examples Overview. It then shows how to use important features like persistence and transactions with MRG Messaging. This chapter does not try to teach the entire MRG Messaging Python API, and it is not encyclopedic in its coverage of AMQP. For more detailed information on the C++ API for MRG Messaging, use pydoc. For instance, to see all available classes, use the command:

$ pydoc qpid

To see the methods for the session object, use the command:

$ pydoc qpid.session

For more detailed information on the AMQP model, see the AMQP specification at http://www.amqp.org.

The instructions in this section assume you have installed the client libraries and started a broker using the instructions shown in Chapter 3, Installing MRG Messaging.