NATS::JetStream::Message
A NATS::JetStream::Message is very similar to a NATS::Message in that
it represents a piece of information published by a NATS client (not
necessarily this NATS client, though). This Message type contains more
information, however, such as information about the stream and consumer
it came from, how many times it's been delivered, etc.
Constructors
Instantiate a NATS::JetStream::Message based on a NATS::Message.
Used by JetStream subscriptions to build JetStream::Message
instances, since JetStream is a layer on top of core NATS.
Instance methods
The message payload, encoded as binary. If you need text,
use data_string.
jetstream.subscribe consumer do |msg|
data = MessagePack.parse(msg.data)
end
The message payload, encoded as binary. If you need text,
use data_string.
jetstream.subscribe consumer do |msg|
data = MessagePack.parse(msg.data)
end
The number of times this particular message has been delivered by this consumer, starting at 1
Any headers that were published with this message, including ones
interpreted by the NATS server, such as Nats-Msg-Id for message
deduplication.
The original subject this message was published to, which can be (and most likely is) different from the subject it was delivered to