KubeMQ

Events Store Reference

Complete reference for KubeMQ Events Store message structure, start positions, storage config, and error codes.

This reference documents every aspect of the KubeMQ Events Store messaging pattern.

Message Structure

Event Store Message (Publish)

Prop

Type

Event Store Receive (Subscription Callback)

Prop

Type

The Sequence and Timestamp fields are assigned by the server at persistence time and are not set by the publisher. They are available only on received events.

Send Result

Prop

Type

Subscription Start Positions

Prop

Type

Subscribe Request

Prop

Type

Channel Naming Rules

RuleConstraintError Code
RequiredCannot be empty102
No trailing dotCannot end with .119
No whitespaceCannot contain spaces108
No wildcardsCannot contain * or >107

Valid channel regex: ^[^\s*>]+[^.]$

Events Store does not support wildcard subscriptions. Both publish and subscribe channel names must be exact. For wildcard support, use plain Events.

Durable Subscriptions

Every Events Store subscription creates a durable name:

DurableName = "{channel}-{group}"
  • On first connection, the EventsStoreTypeData determines the start position
  • On subsequent connections with the same durable name, the start position is ignored — the subscription resumes from the last tracked position
  • To force a fresh replay, use a different group name

Consumer Groups

When multiple subscribers specify the same Group on the same channel:

  • Each event is delivered to exactly one member (round-robin)
  • The group's position is tracked durably
  • Adding or removing members rebalances delivery automatically
  • Groups are independent per channel

Routing (Multicast)

CharacterPurposeExample
;Separate channels of the same typeaudit;compliance
:Specify target pattern typeevents_store:audit;events:notify;queues:process

For Events Store publish, channels without a prefix default to events_store. Routed messages are tagged with X-KUBEMQ-ROUTED=true.

Storage Configuration

Prop

Type

File Store Configuration

Prop

Type

Storage Utilization Thresholds

UtilizationLevelPolling IntervalPublishing
0-80%Normal5 secondsAllowed
80-90%Warning3 secondsAllowed (warnings logged)
90-95%Critical2 secondsAllowed (errors logged)
Above 95%Disabled1 secondBlocked

Publishing automatically resumes when utilization drops below 95%.

Transport Protocols

gRPC

  • Publish: SendEvent(pb.Event) with Store=true
  • Publish Stream: SendEventsStream() — bidirectional streaming, result sent for every store event
  • Subscribe: SubscribeToEvents(pb.Subscribe) with SubscribeType=EventsStore
  • Default port: 50000

REST

  • Publish: POST /send with isEvents=false
  • Subscribe: WebSocket with subscribe_type=events_store
  • Default port: 9090

Delivery Semantics

AspectBehavior
Delivery guaranteeAt-least-once
PersistenceDisk-backed file store
OrderingEvents delivered in sequence order per channel
Sequence numbersMonotonically increasing, starting from 1 per channel
AcknowledgmentAsynchronous publish ack
Durable namesPosition tracked across reconnections
ReplayYes (6 start positions)

Events Store vs Events

FeatureEvents StoreEvents
PersistenceYes (disk-backed)No (memory only)
ReplayYes (6 start positions)No
Delivery guaranteeAt-least-onceAt-most-once
Wildcard subscriptionsNoYes (*, >)
Consumer groupsDurableEphemeral
Sequence numbersYesNo
Server timestampsYesNo
LatencySlightly higher (disk write)Lowest
Storage utilization limitsYes (80/90/95% thresholds)No

SDK Quick Reference

client.SendEventStore(ctx, event)
client.SendEventsStoreStream(ctx, opts...)
client.SubscribeToEventsStore(ctx, channel, group, startPos, opts...)
client.publish_event_store(message)
client.open_events_store_stream(on_result, on_error)
client.subscribe_to_events_store(subscription, cancel)
client.sendEventStore(message)
client.sendEventsStoreStream(opts)
client.subscribeToEventsStore(opts)
client.sendEventsStoreMessage(message)
client.openEventsStoreStream(onResult, onError)
client.subscribeToEventsStore(subscription)
client.SendEventStoreAsync(message)
client.OpenEventsStoreStream(onResult, onError)
client.SubscribeToEventsStoreAsync(subscription)
client.sendEventStore(message)
client.openEventsStoreStream(onResult, onError)
client.subscribeToEventsStore { ... }
client->SendEventStore(message)
client->OpenEventsStoreStream(onResult, onError)
client->SubscribeToEventsStore(channel, group, startPos, onEvent, onError)
client.send_event_store(event).await
client.send_event_store_stream().await       // returns a stream; stream.send(event)
client.subscribe_to_events_store(channel, group, EventsStoreSubscription::StartFromFirst, on_event, None).await
client.send_event_store(msg)
client.create_events_store_sender              # sender.publish(msg)
client.subscribe_to_events_store(subscription, cancellation_token:, on_error:) { |event| ... }
KubeMQ.Client.send_event_store(client, event)
KubeMQ.Client.send_event_store(client, event)  # stream-style: send in rapid succession
KubeMQ.Client.subscribe_to_events_store(client, channel, start_at: :start_new_only, on_event: fn event -> ... end)

Error Codes

Validation Errors

CodeErrorDescription
101Invalid ClientIDClientID is empty
102Invalid ChannelChannel is empty
107Invalid WildcardsChannel contains * or >
108Invalid WhitespaceChannel contains spaces
110Invalid MessageBoth Body and Metadata are empty
111Invalid Subscription TypeEventsStoreTypeData is Undefined (0)
112Invalid Sequence ValueStartAtSequence value is 0 or negative
113Invalid Time ValueStartAtTime value is 0 or negative
114Invalid Time Delta ValueStartAtTimeDelta value is 0 or negative
118Wrong Subscribe TypeEvent store parameters set but subscribe type is not events_store
119Invalid Channel SeparatorChannel ends with .

Runtime Errors

ErrorCauseResolution
ErrShutdownModeServer is shutting downReconnect after server restart
ErrConnectionNoAvailableConnection is downSDK auto-reconnects; check server health
Storage utilization exceededDisk usage above 95%Free disk space or adjust retention settings
Authorization deniedCasbin policy rejected the operationVerify client permissions

Was this page helpful?

On this page