Skip to content

AMQP 0-9-1 Operation Binding v0.2.0

The AMQP operation binding provides detailed control over message routing and delivery behavior in AMQP 0-9-1. It allows you to configure properties such as message expiration, priority, delivery mode, and routing destinations.

Overview

This binding allows you to define AMQP-specific properties for publish and subscribe operations. These properties give you fine-grained control over how messages are handled by the broker.

Operation Properties

PropertyTypeDescription
expirationintegerTTL (Time-To-Live) for the message in milliseconds. It MUST be greater than or equal to zero.
userIdstringIdentifies the user who has sent the message.
cc[string]The routing keys the message should be routed to at the time of publishing.
priorityintegerA priority for the message. Higher numbers indicate higher priority.
deliveryModeintegerDelivery mode of the message. 1 for transient, 2 for persistent.
mandatorybooleanIf true, the message is returned to the publisher if it cannot be routed to any queue.
bcc[string]Like cc but the routing keys are not passed to the consumer.
replyTostringName of the queue where the consumer should send the response.
timestampbooleanIf true, the message MUST include a timestamp property.
ackbooleanIf true, the consumer should acknowledge the message.
bindingVersionstringThe version of this binding. For v0.2.0, this MUST be 0.2.0.

Examples

Persistent, High-Priority Message

yaml
operations:
  highPriorityTask:
    bindings:
      amqp:
        deliveryMode: 2 # Persistent
        priority: 10
        mandatory: true
        timestamp: true
        ack: true
        bindingVersion: '0.2.0'

Request-Reply Pattern with replyTo

This example uses the replyTo property to specify a callback queue for a response message.

yaml
operations:
  getUserProfile:
    bindings:
      amqp:
        replyTo: 'user.profile.response.queue'
        deliveryMode: 1 # Transient is fine for RPC
        userId: 'api-gateway'
        ack: true
        bindingVersion: '0.2.0'

Blind Carbon Copy (BCC) for Auditing

yaml
operations:
  processPayment:
    bindings:
      amqp:
        deliveryMode: 2 # Persistent
        bcc:
          - external.audit.trail
        mandatory: true
        ack: true
        bindingVersion: '0.2.0'

Migration Guide to v0.3.0

The replyTo field was removed in version 0.3.0 of this binding. The recommended approach for request-reply patterns is to use the standard replyTo field in the AsyncAPI Message Object, rather than a binding-specific property.