class Crabbit::Delivery

Overview

One logical message delivered from a RabbitMQ stream.

The raw AMQP payload is available immediately. #message decodes it lazily and caches the result. Pull consumers must call #processed! after successful processing so Crabbit can replenish chunk credit and advance the recovery offset.

Defined in:

crabbit/consumer.cr

Instance Method Summary

Instance Method Detail

def body : Bytes #

Returns the logical Data body from #message.


[View source]
def committed_chunk_id : UInt64 #

Returns the committed chunk ID reported by RabbitMQ.


[View source]
def message : Message #

Lazily decodes and returns the complete AMQP message.


[View source]
def offset : UInt64 #

Returns the absolute stream offset.


[View source]
def processed! : Nil #

Idempotently marks this delivery as processed.

Credit is replenished only after every logical delivery in the same broker chunk is processed.


[View source]
def processed? : Bool #

Returns whether processing was acknowledged locally.


[View source]
def raw : Bytes #

Returns the complete encoded AMQP message bytes.

This buffer owns the storage referenced by zero-copy #message values.


[View source]
def stream : String #

Returns the source stream name.


[View source]
def timestamp : Time #

Returns the broker chunk timestamp.


[View source]