Package com.babelqueue
Record Class Envelope
java.lang.Object
java.lang.Record
com.babelqueue.Envelope
- Record Components:
job- the message URN (never a class name)traceId- correlation id, preserved across every hopdata- the pure-JSON payloadmeta- the immutable metadata blockattempts- the top-level transport retry counterdeadLetter- the dead-letter block, ornulluntil dead-lettered
public record Envelope(String job, String traceId, Map<String,Object> data, Meta meta, int attempts, DeadLetter deadLetter)
extends Record
The canonical BabelQueue wire message: a strict, language-neutral JSON shape
(
{job, trace_id, data, meta, attempts}) that every SDK produces and
consumes identically — no language-specific serialization on the wire.
Build one with EnvelopeCodec.make(java.lang.String, java.util.Map<java.lang.String, java.lang.Object>), render it with
EnvelopeCodec.encode(com.babelqueue.Envelope), and parse inbound bytes with
EnvelopeCodec.decode(java.lang.String). The record is immutable; DeadLetters
returns a copy with a DeadLetter attached.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the value of theattemptsrecord component.data()Returns the value of thedatarecord component.Returns the value of thedeadLetterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.job()Returns the value of thejobrecord component.meta()Returns the value of themetarecord component.final StringtoString()Returns a string representation of this record class.traceId()Returns the value of thetraceIdrecord component.
-
Constructor Details
-
Envelope
public Envelope(String job, String traceId, Map<String, Object> data, Meta meta, int attempts, DeadLetter deadLetter) Creates an instance of aEnveloperecord class.- Parameters:
job- the value for thejobrecord componenttraceId- the value for thetraceIdrecord componentdata- the value for thedatarecord componentmeta- the value for themetarecord componentattempts- the value for theattemptsrecord componentdeadLetter- the value for thedeadLetterrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
job
Returns the value of thejobrecord component.- Returns:
- the value of the
jobrecord component
-
traceId
Returns the value of thetraceIdrecord component.- Returns:
- the value of the
traceIdrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
meta
Returns the value of themetarecord component.- Returns:
- the value of the
metarecord component
-
attempts
public int attempts()Returns the value of theattemptsrecord component.- Returns:
- the value of the
attemptsrecord component
-
deadLetter
Returns the value of thedeadLetterrecord component.- Returns:
- the value of the
deadLetterrecord component
-