Package com.babelqueue.outbox
Record Class OutboxRecord
java.lang.Object
java.lang.Record
com.babelqueue.outbox.OutboxRecord
- Record Components:
id- the outbox row id (the store's primary key, notmeta.id)body- the frozen, encoded envelope bytes, byte-for-byte as storedqueue- the logical queue the relay should publish toattempts- how many times the relay has already tried to publish this row
One pending row read back from an
OutboxStore for the OutboxRelay to publish.
It pairs the store's own bookkeeping (id, attempts) with the verbatim, frozen
wire envelope (body) and the queue it should go to.
body is the exact EnvelopeCodec.encode(com.babelqueue.Envelope) output (UTF-8 bytes)
that was handed to OutboxStore.save(byte[], String) — the relay publishes these bytes
unchanged (GR-1/GR-5), so trace_id is preserved end-to-end (GR-4) without the relay
ever decoding or rebuilding the envelope.
-
Constructor Summary
ConstructorsConstructorDescriptionOutboxRecord(String id, byte[] body, String queue) A freshly stored record the relay has not yet attempted.OutboxRecord(String id, byte[] body, String queue, int attempts) Creates an instance of aOutboxRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the value of theattemptsrecord component.byte[]body()Returns the value of thebodyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.queue()Returns the value of thequeuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OutboxRecord
A freshly stored record the relay has not yet attempted. -
OutboxRecord
Creates an instance of aOutboxRecordrecord class.
-
-
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 '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
body
public byte[] body()Returns the value of thebodyrecord component.- Returns:
- the value of the
bodyrecord component
-
queue
Returns the value of thequeuerecord component.- Returns:
- the value of the
queuerecord component
-
attempts
public int attempts()Returns the value of theattemptsrecord component.- Returns:
- the value of the
attemptsrecord component
-