Package eu.vstoyanov.natsy.jetstream
Class PublishExpectations
-
- All Implemented Interfaces:
public final class PublishExpectationsExpectations for JetStream publishing to ensure message ordering and deduplication
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPublishExpectations.Companion
-
Field Summary
Fields Modifier and Type Field Description private StringexpectedStreamprivate LongexpectedLastSequenceprivate LongexpectedLastSubjectSequenceprivate StringexpectedLastMsgIdprivate StringmessageIdpublic final static PublishExpectations.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description PublishExpectations()
-
Method Summary
Modifier and Type Method Description final StringgetExpectedStream()Expected stream name - validates publish went to correct stream final UnitsetExpectedStream(String value)Expected stream name - validates publish went to correct stream final LonggetExpectedLastSequence()Expected last sequence number in the stream final UnitsetExpectedLastSequence(Long value)Expected last sequence number in the stream final LonggetExpectedLastSubjectSequence()Expected last sequence number for this specific subject final UnitsetExpectedLastSubjectSequence(Long value)Expected last sequence number for this specific subject final StringgetExpectedLastMsgId()Expected last message ID for ordering validation final UnitsetExpectedLastMsgId(String value)Expected last message ID for ordering validation final StringgetMessageId()Message ID for the current message (deduplication) final UnitsetMessageId(String value)Message ID for the current message (deduplication) final PublishOptionstoPublishOptions()Convert to NATS PublishOptions -
-
Method Detail
-
getExpectedStream
final String getExpectedStream()
Expected stream name - validates publish went to correct stream
-
setExpectedStream
final Unit setExpectedStream(String value)
Expected stream name - validates publish went to correct stream
-
getExpectedLastSequence
final Long getExpectedLastSequence()
Expected last sequence number in the stream
-
setExpectedLastSequence
final Unit setExpectedLastSequence(Long value)
Expected last sequence number in the stream
-
getExpectedLastSubjectSequence
final Long getExpectedLastSubjectSequence()
Expected last sequence number for this specific subject
-
setExpectedLastSubjectSequence
final Unit setExpectedLastSubjectSequence(Long value)
Expected last sequence number for this specific subject
-
getExpectedLastMsgId
final String getExpectedLastMsgId()
Expected last message ID for ordering validation
-
setExpectedLastMsgId
final Unit setExpectedLastMsgId(String value)
Expected last message ID for ordering validation
-
getMessageId
final String getMessageId()
Message ID for the current message (deduplication)
-
setMessageId
final Unit setMessageId(String value)
Message ID for the current message (deduplication)
-
toPublishOptions
final PublishOptions toPublishOptions()
Convert to NATS PublishOptions
- Returns:
PublishOptions if any expectations are set, null otherwise
-
-
-
-