Skip to content

amqphub/equipage

Repository files navigation

Equipage

main

AMQP 1.0 messaging example programs implemented using a variety of messaging APIs

API Connect Send Receive Request Respond
AMQP.Net Lite Connect.cs Send.cs Receive.cs Request.cs Respond.cs
Qpid JMS Connect.java Send.java Receive.java Request.java Respond.java
Qpid Proton C++ connect.cpp send.cpp receive.cpp request.cpp respond.cpp
Qpid Proton Python connect.py send.py receive.py request.py respond.py
Qpid Proton Ruby connect.rb send.rb receive.rb request.rb respond.rb
Rhea connect.js send.js receive.js request.js respond.js

Basic examples

  • connect - Connect to a messaging server
  • send - Send a message
  • receive - Receive messages
  • request - Send a request and receive a response
  • respond - Receive requests and send responses

Connect

Establish a connection, print to the console when connected, and exit.

Usage: connect <connection-url>

    $ python connect.py amqp://example.net
    CONNECT: Connected to 'amqp://example.net'

Send

Send one message and exit.

Usage: send <connection-url> <address> <message-body>

    $ python send.py amqp://example.net examples "Hello there"
    SEND: Connected to 'amqp://example.net'
    SEND: Opened sender for target address 'examples'
    SEND: Sent message 'Hello there'

Receive

Receive messages until the program is terminated. If specified, exit after <message-count> messages are received.

Usage: receive <connection-url> <address> [<message-count>]

    $ python receive.py amqp://example.net examples
    RECEIVE: Connected to 'amqp://example.net'
    RECEIVE: Opened receiver for source address 'examples'
    RECEIVE: Received message 'Hello there'

Request

Send one request, receive the response, print the response to the console, and exit.

Usage: request <connection-url> <address> <message-body>

    $ python request.py amqp://example.net examples "abcdef"
    REQUEST: Connected to 'amqp://example.net'
    REQUEST: Opened sender for target address 'examples'
    REQUEST: Sent request message 'abcdef'
    REQUEST: Received response message 'ABCDEF'

Respond

Receive requests and send responses until the program is terminated. If specified, exit after <message-count> messages are received.

Usage: respond <connection-url> <address> [<message-count>]

    $ python respond.py amqp://example.net examples
    RESPOND: Connected to 'amqp://example.net'
    RESPOND: Opened receiver for source address 'examples'
    RESPOND: Received request message 'abcdef'
    RESPOND: Sent response message 'ABCDEF'

Content outline

  • Basic examples (in the root dir or 'basic')
    • connect
    • send
    • receive
    • request
    • respond
  • Acknowledgment
    • receive
  • Authentication (authentication)
    • password
    • kerberos
  • Automatic resource creation (auto-create)
    • queue-send
    • queue-receive
    • topic-send
    • topic-receive
  • Reconnect and failover (reconnect)
    • connect
    • failover
    • custom-failover
  • Servers (servers)
    • receive
    • respond
  • Subscriptions (subscriptions)
    • subscribe
    • durable-subscribe
    • shared-subscribe
    • durable-shared-subscribe
  • TLS (tls)
    • connect
  • Error handling (error-handling)
  • Filters (filters)
  • Interoperating with JMS (jms-interop)
  • Logging (logging)
  • Message content (message-content)
  • Message groups (message-groups)
  • Multithreaded applications (threading)
  • Timers (timers)
  • Tracing (tracing)
  • Codec (codec)
  • IO integration (io-integration)

General properties

  • The most basic sending programs send one message and then exit.

  • By default, receiving programs keep running until the user terminates them. If the optional MESSAGE-COUNT argument is supplied, they exit after the given number of messages have been received.

  • Each example program is contained in a single file, with exceptions where necessary.

  • Option parsing is deliberately simple, using positional arguments.