Class LogBackedDurableQueue
java.lang.Object
org.j7m.middleware.messaging.LogBackedDurableQueue
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.api.messaging.DurableQueue, org.j7m.middleware.api.messaging.Inbox, org.j7m.middleware.api.messaging.Outbox, org.j7m.middleware.api.messaging.OutboxPublisher, org.j7m.middleware.api.messaging.OutboxRelay
public final class LogBackedDurableQueue
extends Object
implements org.j7m.middleware.api.messaging.DurableQueue, org.j7m.middleware.api.messaging.Outbox, org.j7m.middleware.api.messaging.Inbox
Local durable-log-backed queue, outbox, and inbox implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionOpens and recovers a log-backed queue. -
Method Summary
Modifier and TypeMethodDescriptionorg.j7m.middleware.api.messaging.AckResultack(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.MessageId messageId, org.j7m.middleware.api.messaging.AckOptions options) voidclose()org.j7m.middleware.api.messaging.EnqueueResultenqueue(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.QueueMessage message, org.j7m.middleware.api.messaging.EnqueueOptions options) health()Returns lightweight health.org.j7m.middleware.api.messaging.InboxStatusorg.j7m.middleware.api.messaging.LeaseBatchlease(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.ConsumerId consumer, org.j7m.middleware.api.messaging.LeaseOptions options) org.j7m.middleware.api.messaging.NackResultnack(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.MessageId messageId, org.j7m.middleware.api.messaging.NackOptions options) org.j7m.middleware.api.messaging.OutboxStatusorg.j7m.middleware.api.messaging.OutboxEntryrecord(org.j7m.middleware.api.messaging.QueueName targetQueue, org.j7m.middleware.api.messaging.QueueMessage message, org.j7m.middleware.api.messaging.EnqueueOptions options) org.j7m.middleware.api.messaging.InboxEntryrecord(org.j7m.middleware.api.reliability.DedupeKey dedupeKey, String resultMetadata, org.j7m.middleware.api.messaging.InboxOptions options) org.j7m.middleware.api.messaging.MessagingRecoveryReportrecover()Replays durable messaging events and rebuilds state.org.j7m.middleware.api.messaging.MessagingRecoveryReportReturns the latest recovery report.intorg.j7m.middleware.api.messaging.QueueStatusstatus(org.j7m.middleware.api.messaging.QueueName queue)
-
Constructor Details
-
LogBackedDurableQueue
Opens and recovers a log-backed queue.- Parameters:
config- queue configuration- Throws:
org.j7m.middleware.api.messaging.MessagingException- when durable recovery fails
-
-
Method Details
-
recoveryReport
public org.j7m.middleware.api.messaging.MessagingRecoveryReport recoveryReport()Returns the latest recovery report.- Returns:
- latest successful or failed recovery report
-
enqueue
public org.j7m.middleware.api.messaging.EnqueueResult enqueue(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.QueueMessage message, org.j7m.middleware.api.messaging.EnqueueOptions options) - Specified by:
enqueuein interfaceorg.j7m.middleware.api.messaging.DurableQueue
-
lease
public org.j7m.middleware.api.messaging.LeaseBatch lease(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.ConsumerId consumer, org.j7m.middleware.api.messaging.LeaseOptions options) - Specified by:
leasein interfaceorg.j7m.middleware.api.messaging.DurableQueue
-
ack
public org.j7m.middleware.api.messaging.AckResult ack(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.MessageId messageId, org.j7m.middleware.api.messaging.AckOptions options) - Specified by:
ackin interfaceorg.j7m.middleware.api.messaging.DurableQueue
-
nack
public org.j7m.middleware.api.messaging.NackResult nack(org.j7m.middleware.api.messaging.QueueName queue, org.j7m.middleware.api.messaging.MessageId messageId, org.j7m.middleware.api.messaging.NackOptions options) - Specified by:
nackin interfaceorg.j7m.middleware.api.messaging.DurableQueue
-
status
public org.j7m.middleware.api.messaging.QueueStatus status(org.j7m.middleware.api.messaging.QueueName queue) - Specified by:
statusin interfaceorg.j7m.middleware.api.messaging.DurableQueue
-
record
public org.j7m.middleware.api.messaging.OutboxEntry record(org.j7m.middleware.api.messaging.QueueName targetQueue, org.j7m.middleware.api.messaging.QueueMessage message, org.j7m.middleware.api.messaging.EnqueueOptions options) - Specified by:
recordin interfaceorg.j7m.middleware.api.messaging.OutboxPublisher
-
relayPending
public int relayPending()- Specified by:
relayPendingin interfaceorg.j7m.middleware.api.messaging.OutboxRelay
-
outboxStatus
public org.j7m.middleware.api.messaging.OutboxStatus outboxStatus()- Specified by:
outboxStatusin interfaceorg.j7m.middleware.api.messaging.Outbox
-
record
public org.j7m.middleware.api.messaging.InboxEntry record(org.j7m.middleware.api.reliability.DedupeKey dedupeKey, String resultMetadata, org.j7m.middleware.api.messaging.InboxOptions options) - Specified by:
recordin interfaceorg.j7m.middleware.api.messaging.Inbox
-
inboxStatus
public org.j7m.middleware.api.messaging.InboxStatus inboxStatus()- Specified by:
inboxStatusin interfaceorg.j7m.middleware.api.messaging.Inbox
-
health
-
recover
public org.j7m.middleware.api.messaging.MessagingRecoveryReport recover()Replays durable messaging events and rebuilds state.- Returns:
- recovery report
- Throws:
org.j7m.middleware.api.messaging.MessagingException- when durable-log or semantic recovery fails
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.j7m.middleware.api.messaging.DurableQueue
-