Class TracedQueue
java.lang.Object
org.j7m.middleware.integrations.TracedQueue
Real replicated-queue facade carrying a bounded, versioned W3C context envelope.
Message context is supplied explicitly and must remain identical on retries. Payloads remain
opaque and are never exported. Send and consumer spans share the persisted production context.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHandler called under the persisted consumer context.static final recordImmutable delivery envelope. -
Constructor Summary
ConstructorsConstructorDescriptionTracedQueue(org.j7m.middleware.distributed.ReplicatedQueue queue, Observability telemetry) Creates an instrumented facade over the real queue. -
Method Summary
Modifier and TypeMethodDescriptionack(String request, String name, String group, String member, long generation, String id, long receipt, Instant deadline) Acknowledges only a committed consumer effect and records confirmed acknowledgements.claim(String request, String name, String group, String member, long generation, long visibilityMillis, Instant deadline) Claims a delivery and records an actual queue claim observation.voidconsume(byte[] envelope, TracedQueue.Handler handler) Processes an encoded queue payload under its persisted remote parent.deadLetters(String name, Instant deadline) Observes the actual retained dead-letter page without exporting identities.static TracedQueue.Messagedecode(byte[] envelope) Decodes an immutable envelope, rejecting unsupported formats and trailing bytes.static byte[]encode(TracedQueue.Message message) Encodes a bounded context envelope for a queue or transactional outbox.send(String request, String name, String id, TracedQueue.Message message, int attempts, Instant deadline) Publishes a deterministic message envelope using a stable request/message identity.
-
Constructor Details
-
TracedQueue
Creates an instrumented facade over the real queue.- Parameters:
queue- authenticated replicated queuetelemetry- concrete export integration
-
-
Method Details
-
send
public String send(String request, String name, String id, TracedQueue.Message message, int attempts, Instant deadline) throws IOException Publishes a deterministic message envelope using a stable request/message identity.- Parameters:
request- stable request identityname- queue nameid- stable message identitymessage- immutable payload and retry-stable propagation metadataattempts- queue delivery attempt limitdeadline- absolute deadline- Returns:
- underlying durable queue result
- Throws:
IOException- on unavailable/unknown outcome
-
claim
public String claim(String request, String name, String group, String member, long generation, long visibilityMillis, Instant deadline) throws IOException Claims a delivery and records an actual queue claim observation.- Parameters:
request- stable claim requestname- queue namegroup- consumer groupmember- member identitygeneration- current assignment generationvisibilityMillis- delivery lease millisecondsdeadline- absolute deadline- Returns:
- underlying MESSAGE/EMPTY result, preserving receipt metadata
- Throws:
IOException- for unavailable or unknown claim
-
ack
public String ack(String request, String name, String group, String member, long generation, String id, long receipt, Instant deadline) throws IOException Acknowledges only a committed consumer effect and records confirmed acknowledgements.- Parameters:
request- stable acknowledgement requestname- queue namegroup- consumer groupmember- live membergeneration- current group generationid- message identityreceipt- current delivery receiptdeadline- absolute deadline- Returns:
- underlying acknowledgement result
- Throws:
IOException- for unknown or unavailable acknowledgement
-
deadLetters
Observes the actual retained dead-letter page without exporting identities.- Parameters:
name- queue namedeadline- absolute deadline- Returns:
- actual first retained dead-letter page
- Throws:
IOException- for query failure
-
consume
Processes an encoded queue payload under its persisted remote parent.- Parameters:
envelope- bytes returned by a successful real queue claimhandler- application callback, such as a transactional inbox consumer- Throws:
Exception- if the envelope or callback fails
-
encode
Encodes a bounded context envelope for a queue or transactional outbox.- Parameters:
message- immutable payload/context- Returns:
- deterministic version-one bytes
- Throws:
IOException- if encoding fails
-
decode
Decodes an immutable envelope, rejecting unsupported formats and trailing bytes.- Parameters:
envelope- at most 32768 encoded bytes- Returns:
- decoded context and independent payload
- Throws:
IOException- for unsupported or malformed bytes
-