Skip to content

Instantly share code, notes, and snippets.

@lmolkova
Last active January 18, 2024 17:12
Show Gist options
  • Save lmolkova/c1b1239a24769e709952cba923eaf4e4 to your computer and use it in GitHub Desktop.
Save lmolkova/c1b1239a24769e709952cba923eaf4e4 to your computer and use it in GitHub Desktop.
Settlement messaging conventions

Settlement in messaging systems

Proposal

Attributes:

  • is there a need in generic?
  • messaging.settlement.settled: boolean

System-specific:

  • messaging.kafka.committed.offset
  • messaging.rabbitmq.ack.type, messaging.rabbitmq.ack.delivery_tag
  • settlement span name SHOULD include settlement kind: queue-name nack (for rabbit) or topic-name commit (for kafka) or queue-name abandon for Azure ServiceBus

Parent:

  • ambient context: delivery span, manual processing span (if available)

Links:

  • to message(s) when available

Kafka

https://docs.confluent.io/platform/current/clients/consumer.html#offset-management

  • Terminology

    • commit
  • Modes: auto/sync/async

  • Attributes

    • offset
    • partition
    • consumer group
  • Parent

    • auto: none/ambient
    • sync/async: ambient: delivery span, manual processing span (if available)
  • Links:

    • messages with commited offset (when known/possible - probably never), none otherwise

RabbitMQ

https://www.rabbitmq.com/consumers.html#acknowledgement-modes

https://www.rabbitmq.com/confirms.html

  • Terminology

    • Delivery Acknowledgement
    • don't mix with publisher confirms
  • Modes

    • automatic (no ack, fire and forget) - similar to async in kafka
      • no client side, it happens on server and acked if consumer received a message at all (TCP ack)
    • manual - sync: span
      • individual and multiple
  • Attributes

    • type: ack, nack, reject
    • deliveryTag
  • Parent

    • sync: ambient: delivery span, manual processing span (if available)
  • Links:

    • message(s) if available

JMS

https://docs.oracle.com/javaee/7/api/index.html?javax/jms/package-summary.html https://jstobigdata.com/jms/guaranteed-delivery-using-jms-message-acknowledgement/

  • Terminology
    • acknowledgement
  • Modes
    • auto (no client action)
    • CLIENT_ACKNOWLEDGE: message.ack() acks all messages received in the session so far
    • DUPS_OK_ACKNOWLEDGE: no ack
    • SESSION_TRANSACTED: JMSContext.commit() or rollback(): commits/rolls-back all mesages in this transaction
  • Attributes
    • session
    • transaction
    • mode

AMQP

http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf

  • Terminology

    • settlement, disposition
  • Modes

    • auto
    • manual
  • Attributes

    • delivery tag
    • settled
    • delivery state: Accepted, Modified, Rejected, Released
    • transaction info
    • error condition, description, info
  • Parent

    • ambient: delivery span, manual processing span (if available)
  • Links:

    • message(s) if available and different from delivery/processing span?

ServiceBus

  • Terminology

    • settlement
  • Modes

    • receive-and-delete (auto, no client call)
    • peek-lock - manual
  • Attributes

    • lock token
    • disposition status
  • Parent

    • ambient: delivery span, manual processing span
  • Links:

    • message if available

EventHubs

  • Terminology

    • checkpoint
  • Modes

    • none
    • manual
  • Attributes

    • sequence number, offset
  • Parent

    • ambient: delivery span, manual processing span
  • Links:

    • none

SNS

N/A - consumers don't follow messageing semantics (e.g. HTTP endpoint)

SQS

https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/features-capabilities.html https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-sqs-messages.html

  • Terminology

    • delete message
    • change visibility timeout
  • Modes

  • Attributes

    • receipthandle
  • Parent

    • ambient: delivery span, manual processing span
  • Links:

    • none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment