KubeMQ
Client SDKsJavaReference

Events Store

Durable events with replay — KubeMQ Java SDK reference.

PubSubClient exposes both publishEventStore and subscribeToEventsStore for persisted events with configurable replay positions.

publishEventStore

EventSendResult publishEventStore(EventStoreMessage message) throws KubeMQException

Persists an event and returns acknowledgement metadata.

sendEventsStoreMessage is a deprecated alias (forRemoval=true) for publishEventStore — prefer publishEventStore in new code.

Parameters:

NameTypeRequiredDescription
messageEventStoreMessageYesChannel, payload, tags

Returns: EventSendResult — IDs and timestamps from the broker.

subscribeToEventsStore

void subscribeToEventsStore(EventsStoreSubscription subscription) throws KubeMQException

Subscribes with replay parameters supplied on EventsStoreSubscription.

Parameters:

NameTypeRequiredDescription
subscriptionEventsStoreSubscriptionYesChannel, group, replay start, callbacks

Replay options

FieldDescription
Start position enumStartNewOnly, StartFromFirst, StartFromLast, StartAtSequence, StartAtTime, StartAtTimeDelta
Companion valueSequence number or epoch millis when required by the enum

Quick Usage

EventsStore.java
try (PubSubClient pub = PubSubClient.builder()
        .address("localhost:50000")
        .clientId("store-demo")
        .build()) {
    EventStoreMessage msg = EventStoreMessage.builder()
        .channel("audit.security")
        .body(payload)
        .build();
    pub.publishEventStore(msg);
}

See Also

Was this page helpful?

On this page