class

LavinMQ::AMQP::Queue

Inherits LavinMQ::AMQP::Argument::DeadLettering < LavinMQ::AMQP::ArgumentTarget < LavinMQ::AMQP::QueueStats < LavinMQ::Stats < LavinMQ::SortableJSON < LavinMQ::PolicyTarget < Reference < Object

Constants

ARGUMENT_VALIDATORS = {__nil: nil, "x-dead-letter-exchange": ArgumentValidator::StringValidator.new, "x-dead-letter-routing-key": ArgumentValidator::DeadLetteringValidator.new, "x-expires": VALIDATOR_INT_ONE, "x-max-length": VALIDATOR_INT_ZERO, "x-max-length-bytes": VALIDATOR_INT_ZERO, "x-message-ttl": VALIDATOR_INT_ZERO, "x-overflow": VALIDATOR_STRING, "x-delivery-limit": VALIDATOR_INT_ZERO, "x-consumer-timeout": VALIDATOR_INT_ZERO, "x-single-active-consumer": VALIDATOR_BOOL, "x-message-deduplication": VALIDATOR_BOOL, "x-cache-size": VALIDATOR_INT_ZERO, "x-cache-ttl": VALIDATOR_INT_ZERO, "x-deduplication-header": VALIDATOR_STRING, "x-delayed-retry-min": VALIDATOR_INT_ONE, "x-delayed-retry-max": VALIDATOR_INT_ONE, "x-delayed-retry-multiplier": VALIDATOR_INT32_ONE}

__nil is a workaround for not being able to declare an empty namedtuple and populate it from macro

DELAYED_RETRY_MAX_DELAY_MS = UInt32::MAX.to_i64
EXPIRE_WAKEUP_GRANULARITY_MS = 10_i64

The expire loop wakes on deadlines rounded up to this many ms, so messages published close together expire in one batch instead of one wakeup per millisecond. Messages are never expired early.

Log = LavinMQ::Log.for("queue")
MAX_EXPIRE_AT = Int64::MAX - EXPIRE_WAKEUP_GRANULARITY_MS

The latest deadline (unix ms) that can be rounded up to the granularity without overflowing. A message whose TTL ends later never expires.

VALIDATOR_BOOL = ArgumentValidator::BoolValidator.new
VALIDATOR_INT32_ONE = ArgumentValidator::IntValidator.new(min_value: 1, max_value: Int32::MAX)
VALIDATOR_INT_ONE = ArgumentValidator::IntValidator.new(min_value: 1)
VALIDATOR_INT_ZERO = ArgumentValidator::IntValidator.new(min_value: 0)
VALIDATOR_STRING = ArgumentValidator::StringValidator.new

Class methods

create(vhost : VHost, name : String, exclusive : Bool = false, auto_delete : Bool = false, arguments : AMQP::Table = AMQP::Table.new)
Source
data_dir(vhost : VHost, name : String, durable : Bool) : String

Where a queue, or an MQTT session, named name keeps its files

Source
generate_name
Source
time_to_expiration_wakeup(expire_at : Int64) : Time::Span

Time until the expire loop should wake up for a message expiring at expire_at (unix ms)

Source
validate_arguments!(arguments : AMQP::Table)
Source

Instance methods

ack(sp : SegmentPosition) : Nil
Source
ack_count
add_consumer(consumer : Client::Channel::Consumer) : Bool

Adds the consumer unless the queue is in exclusive use, checked atomically with the add. Returns false if the consumer was refused for that reason, raises ClosedError if the queue is closed or about to be deleted.

Source
arguments
Source
auto_delete?
Source
basic_get(no_ack, force = false, & : Envelope -> Nil) : Bool
Source
basic_get_unacked_push(msg : UnackedMessage) : Nil
Source
basic_get_unacked_reject!
Source
basic_get_unacked_size
Source
bindings
Source
close
Source
closed?
Source
confirm_count
consume_get(no_ack, & : Envelope -> Nil) : Bool

If nil is returned it means that the delivery limit is reached

Source
consumer_count
Source
consumer_timeout
Source
consumers
Source
consumers_empty
Source
consumers_empty?
Source
consumers_size
Source
current_stats_details

Like stats_details but without log

dedup_count
delete
Source
deliver_count
deliver_get_count
deliver_loop_wg
Source
deliver_no_ack_count
details_tuple
Source
durable?
Source
empty
Source
empty?
Source
exclusive?
Source
exclusive_owner

The connection that declared this exclusive queue, told when the queue is deleted

Source
exclusive_owner=(exclusive_owner : AMQP::Client | Nil)

The connection that declared this exclusive queue, told when the queue is deleted

Source
get_count
get_no_ack_count
has_exclusive_consumer?
Source
has_priority_consumers?
Source
immediate_delivery?
Source
in_use?
Source
inspect(io : IO)

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
internal?
Source
match?(durable, exclusive, auto_delete, arguments)
Source
match?(frame)
Source
message_count
Source
message_count_log
message_expire_fiber_active?
Source
name
Source
pause!
Source
paused
Source
publish(msg : Message) : PublishResult
Source
publish_count
purge(max_count : Int = UInt32::MAX) : UInt32
Source
read(sp : SegmentPosition) : Envelope

Used for when channel recovers without requeue eg. redelivers messages it already has unacked

Source
redeclare
Source
redeliver_count
reject(sp : SegmentPosition, requeue : Bool)

Consumer-initiated reject (basic.reject and basic.nack): delays via the retry queue if configured

Source
reject_count
requeue(sp : SegmentPosition)

Broker-initiated requeue (channel close, basic.recover): always instant, never via the retry queue

Source
restart!
Source
resume!
Source
return_unroutable_count
rm_consumer(consumer : Client::Channel::Consumer)
Source
settings
Source
single_active_consumer
Source
single_active_consumer_change
Source
state
Source
state_match?(states : Array(QueueState)) : Bool
Source
stats_details
to_json(json : JSON::Builder, consumer_limit : Int32 = -1)
Source
unacked_count_log
unacked_messages
Source
update_rates
vhost
Source

Nested types