Chapter 42. Zend_Queue

Table of Contents

42.1. Introduction
42.2. Example usage
42.3. Framework
42.3.1. Introduction
42.3.2. Commonality among adapters
42.4. Adapters
42.4.1. Specific Adapters - Configuration settings
42.4.1.1. Apache ActiveMQ - Zend_Queue_Adapter_Activemq
42.4.1.2. Db - Zend_Queue_Adapter_Db
42.4.1.3. MemcacheQ - Zend_Queue_Adapter_Memcacheq
42.4.1.4. Zend Platform Job Queue - Zend_Queue_Adapter_PlatformJobQueue
42.4.1.5. Array - Zend_Queue_Adapter_Array
42.4.2. Notes for Specific Adapters
42.4.2.1. Apache ActiveMQ
42.4.2.2. Zend_Db
42.4.2.3. MemcacheQ
42.4.2.4. Zend Platform Job Queue
42.4.2.5. Array (local)
42.5. Customizing Zend_Queue
42.5.1. Creating your own adapter
42.5.2. Creating your own message class
42.5.3. Creating your own message iterator class
42.5.4. Creating your own queue class
42.6. Stomp
42.6.1. Stomp - Supporting classes

42.1. Introduction

Zend_Queue provides a factory function to create specific queue client objects.

A message queue is a method for distributed processing. For example, a Job Broker application may accept multiple applications for jobs from a variety of sources.

You could create a queue "/queue/applications" that would have a sender and a receiver. The sender would be any available source that could connect to your message service or indirectly to an application (web) that could connect to the message service.

The sender sends a message to the queue:

<resume>
    <name>John Smith</name>
    <location>
        <city>San Francisco</city>
        <state>California</state>
        <zip>00001</zip>
    </location>
    <skills>
        <programming>PHP</programming>
        <programming>Perl</programming>
    </skills>
</resume>

The recipient or consumer of the queue would pick up the message and process the resume.

There are many messaging patterns that can be applied to queues to abstract the flow of control from the code and provide metrics, transformations, and monitoring of messages queues. A good book on messaging patterns is Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions (Addison-Wesley Signature Series) (ISBN-10 0321127420; ISBN-13 978-0321127426).