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 KubeMQExceptionPersists an event and returns acknowledgement metadata.
sendEventsStoreMessageis a deprecated alias (forRemoval=true) forpublishEventStore— preferpublishEventStorein new code.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
message | EventStoreMessage | Yes | Channel, payload, tags |
Returns: EventSendResult — IDs and timestamps from the broker.
subscribeToEventsStore
void subscribeToEventsStore(EventsStoreSubscription subscription) throws KubeMQExceptionSubscribes with replay parameters supplied on EventsStoreSubscription.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
subscription | EventsStoreSubscription | Yes | Channel, group, replay start, callbacks |
Replay options
| Field | Description |
|---|---|
| Start position enum | StartNewOnly, StartFromFirst, StartFromLast, StartAtSequence, StartAtTime, StartAtTimeDelta |
| Companion value | Sequence number or epoch millis when required by the enum |
Quick Usage
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?