seqeron 0.18.0
Loading...
Searching...
No Matches
SequencedFrame.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <cstdint>
5
6#include "Aeron.h"
7#include "concurrent/logbuffer/LogBufferDescriptor.h"
8
9// Generated SBE C++ codecs from sbe-frame.xml (via GenerateFrameSbeCodecs)
10#include "org_limitless_seqeron_sbe_frame/ApplicationRegistered.h"
11#include "org_limitless_seqeron_sbe_frame/ClusterHeartbeat.h"
12#include "org_limitless_seqeron_sbe_frame/ClusterStarted.h"
13#include "org_limitless_seqeron_sbe_frame/ClusterStopped.h"
14#include "org_limitless_seqeron_sbe_frame/ConnectionClosed.h"
15#include "org_limitless_seqeron_sbe_frame/ConnectionOpened.h"
16#include "org_limitless_seqeron_sbe_frame/GatewayActivationRequested.h"
17#include "org_limitless_seqeron_sbe_frame/GatewayActive.h"
18#include "org_limitless_seqeron_sbe_frame/GatewayRegistered.h"
19#include "org_limitless_seqeron_sbe_frame/GatewayStarted.h"
20#include "org_limitless_seqeron_sbe_frame/GroupsRegistered.h"
21#include "org_limitless_seqeron_sbe_frame/LeadershipChanged.h"
22#include "org_limitless_seqeron_sbe_frame/MessageHeader.h"
23#include "org_limitless_seqeron_sbe_frame/PayloadIdRegistered.h"
24#include "org_limitless_seqeron_sbe_frame/Sequenced.h"
25#include "org_limitless_seqeron_sbe_frame/SequencedHeader.h"
26#include "org_limitless_seqeron_sbe_frame/SequencedSystem.h"
27#include "org_limitless_seqeron_sbe_frame/SequencedSystemHeader.h"
28#include "org_limitless_seqeron_sbe_frame/SessionClosed.h"
29#include "org_limitless_seqeron_sbe_frame/SnapshotEnd.h"
30#include "org_limitless_seqeron_sbe_frame/SnapshotPolicyRegistered.h"
31#include "org_limitless_seqeron_sbe_frame/SnapshotRequested.h"
32#include "org_limitless_seqeron_sbe_frame/SnapshotStarted.h"
33#include "org_limitless_seqeron_sbe_frame/Unsequenced.h"
34#include "org_limitless_seqeron_sbe_frame/UnsequencedHeader.h"
35
36// The sequenced stream's wire contract: what a frame on it is, how to decode one, and where it sits.
37// Shared by both stream clients and every consumer; kept apart from ClusterStreamClient.hpp so reading a
38// frame does not drag in the archive client.
39
41
42// ── Constants matching SequencerService / SequencerServer ──────────────────────
43
44// The queue: the node-local IPC stream every node republishes each sequenced frame on and records. A
45// consumer subscribes untethered (see ReplayerStreamReceiver), the recording is found by stream id alone.
46// Each group's queue is this channel on its own stream, queueStreamId(groupId).
47inline constexpr const char* QUEUE_CHANNEL = "aeron:ipc?alias=seqeron-queue";
48
49// The width of groupMask: groupIds run 1 to 16.
50inline constexpr std::int32_t MAX_GROUPS = 16;
51
52// Group groupId's queue is stream QUEUE_STREAM_ID_BASE + groupId.
53inline constexpr std::int32_t QUEUE_STREAM_ID_BASE = 2000;
54
61constexpr std::int32_t queueStreamId(const std::int32_t groupId)
62{
63 return QUEUE_STREAM_ID_BASE + groupId;
64}
65
66// Period of the cluster clock: every node emits a ClusterHeartbeat carrying the consensus timestamp, so a
67// consumer has a clock that advances while producers are silent, and a queue watchdog has whole periods to
68// span. The Java twin is FrameLayer.CLUSTER_HEARTBEAT_INTERVAL_MS; keep the two in step.
69inline constexpr std::int64_t CLUSTER_HEARTBEAT_INTERVAL_MS = 1000;
70inline constexpr std::int64_t CLUSTER_HEARTBEAT_INTERVAL_NS = CLUSTER_HEARTBEAT_INTERVAL_MS * 1'000'000;
71
72// ── Limits ────────────────────────────────────────────────────────────────────
73//
74// This language's compiled-in mirror of spec §12 (the Java one is FrameLayer); a change is a wire change
75// (V-3) and lands in both. Never read from a transport per frame: S-3 forbids checking a node's own MTU.
76
77// An 8960-byte IPC MTU, one jumbo frame, less the 86 bytes of Aeron data header and sequenced envelope, so a
78// queue whose MTU is that large never fragments.
79inline constexpr std::uint16_t MAX_PAYLOAD_LENGTH = 8874;
80
81// Smallest ingress frame of either family: the framing header, the header composite and the payload's own
82// 2-byte length prefix. Read off the codecs rather than written out, as the Java twin is, so a schema
83// change to the ingress framing moves both languages instead of stranding this one at the old number.
84inline constexpr std::uint16_t MIN_INGRESS_LENGTH = static_cast<std::uint16_t>(
85 sbe::frame::MessageHeader::encodedLength() + sbe::frame::UnsequencedHeader::encodedLength() +
86 sbe::frame::Unsequenced::payloadHeaderLength());
87
88// Largest ingress frame: a full payload behind that framing -- 8904 bytes. §9.2 condition 1's ceiling.
89inline constexpr std::uint16_t MAX_INGRESS_LENGTH = MIN_INGRESS_LENGTH + MAX_PAYLOAD_LENGTH;
90
91// ── The systemEventType table (doc/seqeron-protocol-spec.md §7) ────────────────
92//
93// A submitted event's value is its payload codec's template id. The five synthesized events have templates
94// of their own and stamp these values at offset 16 so that field discriminates every frame on the queue.
95// The Java twin is SystemFrame; keep the two in step.
96inline constexpr std::uint16_t CONNECTION_OPENED = sbe::frame::ConnectionOpened::sbeTemplateId();
97inline constexpr std::uint16_t CONNECTION_CLOSED = sbe::frame::ConnectionClosed::sbeTemplateId();
98inline constexpr std::uint16_t LEADERSHIP_CHANGED = 5; // synthesis-only
99inline constexpr std::uint16_t CLUSTER_STARTED = sbe::frame::ClusterStarted::sbeTemplateId();
100inline constexpr std::uint16_t CLUSTER_STOPPED = sbe::frame::ClusterStopped::sbeTemplateId();
101inline constexpr std::uint16_t CLUSTER_HEARTBEAT = 16; // synthesis-only
102inline constexpr std::uint16_t GATEWAY_REGISTERED = sbe::frame::GatewayRegistered::sbeTemplateId();
103inline constexpr std::uint16_t GATEWAY_ACTIVE = 18; // synthesis-only
104inline constexpr std::uint16_t GATEWAY_STARTED = sbe::frame::GatewayStarted::sbeTemplateId();
105inline constexpr std::uint16_t PAYLOAD_ID_REGISTERED = sbe::frame::PayloadIdRegistered::sbeTemplateId();
106inline constexpr std::uint16_t GATEWAY_ACTIVATION_REQUESTED = sbe::frame::GatewayActivationRequested::sbeTemplateId();
107inline constexpr std::uint16_t APPLICATION_REGISTERED = sbe::frame::ApplicationRegistered::sbeTemplateId();
108inline constexpr std::uint16_t SNAPSHOT_REQUESTED = sbe::frame::SnapshotRequested::sbeTemplateId();
109inline constexpr std::uint16_t SNAPSHOT_END = sbe::frame::SnapshotEnd::sbeTemplateId();
110inline constexpr std::uint16_t SNAPSHOT_POLICY_REGISTERED = sbe::frame::SnapshotPolicyRegistered::sbeTemplateId();
111inline constexpr std::uint16_t SNAPSHOT_STARTED = 30; // synthesis-only
112inline constexpr std::uint16_t SESSION_CLOSED = 31; // synthesis-only
113inline constexpr std::uint16_t GROUPS_REGISTERED = sbe::frame::GroupsRegistered::sbeTemplateId();
114
115// ingressBlockLength's answer for a systemEventType that may not be submitted.
116inline constexpr std::int32_t NOT_INGRESS_LEGAL = -1;
117
125constexpr std::int32_t ingressBlockLength(const std::uint16_t systemEventType)
126{
127 switch (systemEventType)
128 {
130 return sbe::frame::ConnectionOpened::sbeBlockLength();
132 return sbe::frame::ConnectionClosed::sbeBlockLength();
133 case CLUSTER_STARTED:
134 return sbe::frame::ClusterStarted::sbeBlockLength();
135 case CLUSTER_STOPPED:
136 return sbe::frame::ClusterStopped::sbeBlockLength();
138 return sbe::frame::GatewayRegistered::sbeBlockLength();
139 case GATEWAY_STARTED:
140 return sbe::frame::GatewayStarted::sbeBlockLength();
142 return sbe::frame::PayloadIdRegistered::sbeBlockLength();
144 return sbe::frame::GatewayActivationRequested::sbeBlockLength();
146 return sbe::frame::ApplicationRegistered::sbeBlockLength();
148 return sbe::frame::SnapshotRequested::sbeBlockLength();
149 case SNAPSHOT_END:
150 return sbe::frame::SnapshotEnd::sbeBlockLength();
152 return sbe::frame::SnapshotPolicyRegistered::sbeBlockLength();
154 return sbe::frame::GroupsRegistered::sbeBlockLength();
155 default:
156 return NOT_INGRESS_LEGAL;
157 }
158}
159
175{
176 std::int64_t clusterSeqNo;
177 std::int64_t groupSeqNo;
178 std::int32_t sourceId;
179 std::int32_t connectionId;
180 std::uint16_t groupMask;
181 std::int64_t sourceSessionId;
182 std::int64_t clusterTimestampNs;
183 std::int64_t receiveTimeNs;
184 bool system;
185 std::uint16_t payloadId;
186 std::uint16_t systemEventType;
187 std::uint16_t templateId;
188 std::uint16_t blockLength;
189 std::uint16_t version;
190 const char* payload;
192 std::uint64_t payloadLength;
193 std::int64_t position;
195};
196
205{
206 bool valid;
207 bool system;
208 std::uint16_t payloadId;
209 std::uint16_t systemEventType;
210 std::int32_t sourceId;
211 std::int32_t connectionId;
212 std::uint16_t groupMask;
213 std::int64_t sourceSessionId;
214 std::int64_t clusterSeqNo;
215 std::int64_t groupSeqNo;
216 std::int64_t clusterTimestampNs;
217 std::uint16_t templateId;
220 std::uint16_t blockLength;
221 std::uint16_t version;
225 const char* payload;
226 std::uint64_t payloadLength;
227};
228
235inline void readSystemHeader(FrameView& view, sbe::frame::SequencedSystemHeader& header)
236{
237 view.system = true;
238 view.systemEventType = header.systemEventType();
239 view.sourceId = header.sourceId();
240 view.connectionId = header.connectionId();
241 view.groupMask = header.groupMask();
242 view.sourceSessionId = header.sessionId();
243 view.clusterSeqNo = header.clusterSeqNo();
244 view.groupSeqNo = header.groupSeqNo();
245 view.clusterTimestampNs = header.timestamp();
246}
247
259inline FrameView unwrapFrame(const char* const frame, const std::uint64_t length)
260{
261 FrameView view{};
262 char* const bytes = const_cast<char*>(frame);
263 if (length < sbe::frame::MessageHeader::encodedLength())
264 {
265 return view;
266 }
267
268 sbe::frame::MessageHeader hdr;
269 hdr.wrap(bytes, 0U, 0U, length);
270 if (hdr.schemaId() != sbe::frame::Sequenced::sbeSchemaId())
271 {
272 return view;
273 }
274 const std::uint64_t blockOffset = sbe::frame::MessageHeader::encodedLength();
275 const std::uint16_t frameTemplateId = hdr.templateId();
276
277 if (frameTemplateId == sbe::frame::Sequenced::sbeTemplateId())
278 {
279 if (length < sbe::frame::Sequenced::sbeBlockAndHeaderLength() + sbe::frame::Sequenced::payloadHeaderLength())
280 {
281 return view;
282 }
283 sbe::frame::Sequenced sequenced;
284 sequenced.wrapForDecode(bytes, blockOffset, hdr.blockLength(), hdr.version(), length);
285 sbe::frame::SequencedHeader& header = sequenced.header();
286 view.payloadId = header.payloadId();
287 view.sourceId = header.sourceId();
288 view.connectionId = header.connectionId();
289 view.groupMask = header.groupMask();
290 view.sourceSessionId = header.sessionId();
291 view.clusterSeqNo = header.clusterSeqNo();
292 view.groupSeqNo = header.groupSeqNo();
293 view.clusterTimestampNs = header.timestamp();
294
295 const std::uint64_t payloadLength = sequenced.payloadLength();
296 // A prefix is a claim about the fragment, not a fact. Rejecting an overrun here is what keeps
297 // SBE's own bounds check from raising it as a throw out of the poll thread, where Image::poll
298 // hands it to the error handler and advances past the frame anyway.
299 if (sbe::frame::Sequenced::sbeBlockAndHeaderLength() + sbe::frame::Sequenced::payloadHeaderLength() +
300 payloadLength >
301 length)
302 {
303 return view;
304 }
305 const char* const payload = sequenced.payload();
306 view.payload = payload;
307 view.payloadLength = payloadLength;
308 view.valid = true;
309 // A payload too short for a messageHeader is still a frame (§5, §13.2) and must reach the consumer
310 // (P-3); templateId/blockLength/version stay 0, which no (payloadId, templateId) dispatch matches.
311 if (payloadLength < sbe::frame::MessageHeader::encodedLength())
312 {
313 return view;
314 }
315 sbe::frame::MessageHeader payloadHdr;
316 payloadHdr.wrap(const_cast<char*>(payload), 0U, 0U, payloadLength);
317 view.templateId = payloadHdr.templateId();
318 view.blockLength = payloadHdr.blockLength();
319 view.version = payloadHdr.version();
320 return view;
321 }
322
323 if (frameTemplateId == sbe::frame::SequencedSystem::sbeTemplateId())
324 {
325 if (length <
326 sbe::frame::SequencedSystem::sbeBlockAndHeaderLength() + sbe::frame::SequencedSystem::bodyHeaderLength())
327 {
328 return view;
329 }
330 sbe::frame::SequencedSystem sequenced;
331 sequenced.wrapForDecode(bytes, blockOffset, hdr.blockLength(), hdr.version(), length);
332 readSystemHeader(view, sequenced.header());
333 // The payload carries no messageHeader — systemEventType named it — so blockLength and version
334 // stay 0 and a consumer supplies its own decoder's compiled constants (§7, V-3).
335 const std::uint64_t bodyLength = sequenced.bodyLength();
336 if (sbe::frame::SequencedSystem::sbeBlockAndHeaderLength() + sbe::frame::SequencedSystem::bodyHeaderLength() +
337 bodyLength >
338 length)
339 {
340 return view;
341 }
342 view.payloadLength = bodyLength;
343 view.payload = sequenced.body();
344 view.valid = true;
345 return view;
346 }
347
348 if (frameTemplateId == sbe::frame::ClusterHeartbeat::sbeTemplateId() ||
349 frameTemplateId == sbe::frame::LeadershipChanged::sbeTemplateId() ||
350 frameTemplateId == sbe::frame::GatewayActive::sbeTemplateId() ||
351 frameTemplateId == sbe::frame::SnapshotStarted::sbeTemplateId() ||
352 frameTemplateId == sbe::frame::SessionClosed::sbeTemplateId())
353 {
354 if (length < blockOffset + sbe::frame::SequencedSystemHeader::encodedLength())
355 {
356 return view;
357 }
358 sbe::frame::SequencedSystemHeader header;
359 header.wrap(bytes, blockOffset, hdr.version(), length);
360 readSystemHeader(view, header);
361 // No payload: the fields are inline in the frame's own block, which a consumer wraps with its own
362 // compiled constants.
363 view.payload = frame + blockOffset;
364 view.payloadLength = length - blockOffset;
365 view.valid = true;
366 }
367 return view;
368}
369
379template<typename Decoder>
380Decoder decodeSequenced(const char* payload, const std::uint64_t payloadLength, const std::uint16_t blockLength,
381 const std::uint16_t version)
382{
383 Decoder decoder;
384 decoder.wrapForDecode(const_cast<char*>(payload), sbe::frame::MessageHeader::encodedLength(), blockLength, version,
385 payloadLength);
386 return decoder;
387}
388
398template<typename Decoder>
399Decoder decodeSystem(const char* message, const std::uint64_t messageLength)
400{
401 Decoder decoder;
402 decoder.wrapForDecode(const_cast<char*>(message), 0, Decoder::sbeBlockLength(), Decoder::sbeSchemaVersion(),
403 messageLength);
404 return decoder;
405}
406
413template<typename Decoder>
414Decoder decodeSystem(const SequencedEvent& event)
415{
416 return decodeSystem<Decoder>(event.payload, event.payloadLength);
417}
418
426template<typename Decoder>
427Decoder decodeSequenced(const SequencedEvent& event)
428{
429 return decodeSequenced<Decoder>(event.payload, event.payloadLength, event.blockLength, event.version);
430}
431
437inline std::int64_t frameStartPosition(const aeron::Header& header)
438{
439 return aeron::concurrent::logbuffer::LogBufferDescriptor::computePosition(
440 header.termId(), header.termOffset(), header.positionBitsToShift(), header.initialTermId());
441}
442
454{
455 std::int64_t clusterSeqNo;
456 std::int32_t sourceId;
457 std::int32_t connectionId;
458 std::int64_t sourceSessionId;
459 std::int64_t clusterTimestampNs;
460 std::int64_t receiveTimeNs;
461 const char* payload;
462 std::uint64_t payloadLength;
463};
464
472template<typename Decoder>
473Decoder decodeSystem(const LifecycleEvent& event)
474{
475 return decodeSystem<Decoder>(event.payload, event.payloadLength);
476}
477
487inline SequencedEvent sequencedEventOf(const FrameView& view, const std::int64_t receiveTimeNs,
488 const std::int64_t position)
489{
491 .groupSeqNo = view.groupSeqNo,
492 .sourceId = view.sourceId,
493 .connectionId = view.connectionId,
494 .groupMask = view.groupMask,
495 .sourceSessionId = view.sourceSessionId,
496 .clusterTimestampNs = view.clusterTimestampNs,
497 .receiveTimeNs = receiveTimeNs,
498 .system = view.system,
499 .payloadId = view.payloadId,
500 .systemEventType = view.systemEventType,
501 .templateId = view.templateId,
502 .blockLength = view.blockLength,
503 .version = view.version,
504 .payload = view.payload,
505 .payloadLength = view.payloadLength,
506 .position = position };
507}
508
515inline LifecycleEvent lifecycleEventOf(const FrameView& view, const std::int64_t receiveTimeNs)
516{
518 .sourceId = view.sourceId,
519 .connectionId = view.connectionId,
520 .sourceSessionId = view.sourceSessionId,
521 .clusterTimestampNs = view.clusterTimestampNs,
522 .receiveTimeNs = receiveTimeNs,
523 .payload = view.payload,
524 .payloadLength = view.payloadLength };
525}
526
527// The wall-clock stamp events carry as receiveTimeNs, shared so both stream clients use one clock.
528inline std::int64_t nowNs()
529{
530 using namespace std::chrono;
531 return duration_cast<nanoseconds>(system_clock::now().time_since_epoch()).count();
532}
533
534} // namespace org::limitless::seqeron::protocol
Definition ProxyProtocol.hpp:8
constexpr std::int32_t ingressBlockLength(const std::uint16_t systemEventType)
Looks up the compiled block length of a submittable system event: §9.2 conditions 8 and 9 in one look...
Definition SequencedFrame.hpp:125
constexpr std::uint16_t GATEWAY_STARTED
Definition SequencedFrame.hpp:104
constexpr std::uint16_t SESSION_CLOSED
Definition SequencedFrame.hpp:112
constexpr std::uint16_t LEADERSHIP_CHANGED
Definition SequencedFrame.hpp:98
constexpr std::int32_t MAX_GROUPS
Definition SequencedFrame.hpp:50
constexpr std::uint16_t CONNECTION_CLOSED
Definition SequencedFrame.hpp:97
SequencedEvent sequencedEventOf(const FrameView &view, const std::int64_t receiveTimeNs, const std::int64_t position)
Fills a SequencedEvent from an unwrapped frame, plus the two stamps that belong to the delivery rathe...
Definition SequencedFrame.hpp:487
constexpr std::uint16_t CONNECTION_OPENED
Definition SequencedFrame.hpp:96
constexpr std::uint16_t GROUPS_REGISTERED
Definition SequencedFrame.hpp:113
constexpr std::uint16_t MAX_INGRESS_LENGTH
Definition SequencedFrame.hpp:89
constexpr std::int32_t NOT_INGRESS_LEGAL
Definition SequencedFrame.hpp:116
constexpr std::uint16_t PAYLOAD_ID_REGISTERED
Definition SequencedFrame.hpp:105
constexpr std::uint16_t SNAPSHOT_STARTED
Definition SequencedFrame.hpp:111
constexpr std::uint16_t MAX_PAYLOAD_LENGTH
Definition SequencedFrame.hpp:79
constexpr std::uint16_t SNAPSHOT_END
Definition SequencedFrame.hpp:109
std::int64_t frameStartPosition(const aeron::Header &header)
Computes the stream position of a frame's first byte; what SequencedEvent::position carries.
Definition SequencedFrame.hpp:437
constexpr std::uint16_t GATEWAY_ACTIVATION_REQUESTED
Definition SequencedFrame.hpp:106
constexpr std::uint16_t GATEWAY_ACTIVE
Definition SequencedFrame.hpp:103
constexpr std::uint16_t CLUSTER_STARTED
Definition SequencedFrame.hpp:99
FrameView unwrapFrame(const char *const frame, const std::uint64_t length)
Reads one fragment into a FrameView, stripping the envelope.
Definition SequencedFrame.hpp:259
LifecycleEvent lifecycleEventOf(const FrameView &view, const std::int64_t receiveTimeNs)
Fills a LifecycleEvent from an unwrapped ConnectionOpened/ConnectionClosed.
Definition SequencedFrame.hpp:515
Decoder decodeSystem(const char *message, const std::uint64_t messageLength)
Wraps a system frame's message in its decoder.
Definition SequencedFrame.hpp:399
constexpr std::int64_t CLUSTER_HEARTBEAT_INTERVAL_MS
Definition SequencedFrame.hpp:69
constexpr std::uint16_t GATEWAY_REGISTERED
Definition SequencedFrame.hpp:102
Decoder decodeSequenced(const char *payload, const std::uint64_t payloadLength, const std::uint16_t blockLength, const std::uint16_t version)
Wraps an application payload held as loose bytes in its decoder, past its own messageHeader.
Definition SequencedFrame.hpp:380
constexpr std::uint16_t MIN_INGRESS_LENGTH
Definition SequencedFrame.hpp:84
void readSystemHeader(FrameView &view, sbe::frame::SequencedSystemHeader &header)
Copies the identity every system message carries; the two composites are the same 44 bytes.
Definition SequencedFrame.hpp:235
constexpr std::int32_t queueStreamId(const std::int32_t groupId)
Names the stream of a group's queue.
Definition SequencedFrame.hpp:61
constexpr std::uint16_t CLUSTER_STOPPED
Definition SequencedFrame.hpp:100
constexpr std::uint16_t APPLICATION_REGISTERED
Definition SequencedFrame.hpp:107
constexpr std::uint16_t SNAPSHOT_REQUESTED
Definition SequencedFrame.hpp:108
constexpr const char * QUEUE_CHANNEL
Definition SequencedFrame.hpp:47
constexpr std::int32_t QUEUE_STREAM_ID_BASE
Definition SequencedFrame.hpp:53
constexpr std::int64_t CLUSTER_HEARTBEAT_INTERVAL_NS
Definition SequencedFrame.hpp:70
constexpr std::uint16_t SNAPSHOT_POLICY_REGISTERED
Definition SequencedFrame.hpp:110
std::int64_t nowNs()
Definition SequencedFrame.hpp:528
constexpr std::uint16_t CLUSTER_HEARTBEAT
Definition SequencedFrame.hpp:101
One frame off the queue, unwrapped: everything a consumer dispatches on, with the envelope stripped.
Definition SequencedFrame.hpp:205
std::uint16_t payloadId
Definition SequencedFrame.hpp:208
bool valid
false for a fragment that is not a frame, or too short to read
Definition SequencedFrame.hpp:206
std::uint64_t payloadLength
Definition SequencedFrame.hpp:226
std::uint16_t systemEventType
Definition SequencedFrame.hpp:209
std::uint16_t version
Definition SequencedFrame.hpp:221
std::int64_t sourceSessionId
Aeron Cluster client session id (header.sessionId)
Definition SequencedFrame.hpp:213
std::int64_t groupSeqNo
this frame's place on its queue (header.groupSeqNo, F-6)
Definition SequencedFrame.hpp:215
std::int32_t connectionId
Definition SequencedFrame.hpp:211
std::int64_t clusterSeqNo
Definition SequencedFrame.hpp:214
std::uint16_t blockLength
The payload's own, to wrap its decoder with; both 0 on any system frame, whose message carries no dec...
Definition SequencedFrame.hpp:220
std::int64_t clusterTimestampNs
cluster consensus time (epoch ns) when committed (header.timestamp)
Definition SequencedFrame.hpp:216
bool system
true: one of the six system messages; payloadId/templateId mean nothing
Definition SequencedFrame.hpp:207
std::uint16_t templateId
application family: the payload's own, never the envelope's
Definition SequencedFrame.hpp:217
std::uint16_t groupMask
the groups whose queues carry it (header.groupMask, §7.4)
Definition SequencedFrame.hpp:212
std::int32_t sourceId
Definition SequencedFrame.hpp:210
const char * payload
What a consumer decodes: the payload, its 8-byte messageHeader included, on an application frame; the...
Definition SequencedFrame.hpp:225
A connection at a producer opening (ConnectionOpened) or closing (ConnectionClosed).
Definition SequencedFrame.hpp:454
std::int32_t sourceId
publishing producer process (header.sourceId)
Definition SequencedFrame.hpp:456
const char * payload
the event's message, for decodeSystem; valid only during the callback
Definition SequencedFrame.hpp:461
std::int64_t receiveTimeNs
wall-clock ns at receipt by this client
Definition SequencedFrame.hpp:460
std::int64_t sourceSessionId
Aeron Cluster session the event was submitted on.
Definition SequencedFrame.hpp:458
std::int64_t clusterSeqNo
Definition SequencedFrame.hpp:455
std::int32_t connectionId
connection at that producer (header.connectionId)
Definition SequencedFrame.hpp:457
std::uint64_t payloadLength
total byte count
Definition SequencedFrame.hpp:462
std::int64_t clusterTimestampNs
cluster consensus time (epoch ns) when committed
Definition SequencedFrame.hpp:459
Carries one message from the cluster stream.
Definition SequencedFrame.hpp:175
std::uint16_t blockLength
payload messageHeader blockLength; 0 on a system frame (see decodeSystem)
Definition SequencedFrame.hpp:188
std::int32_t sourceId
Fixed constant identifying the submitting producer process (header.sourceId)
Definition SequencedFrame.hpp:178
std::uint16_t templateId
the message's messageHeader templateId; picks the specific decode
Definition SequencedFrame.hpp:187
std::int64_t sourceSessionId
Aeron Cluster client session id (header.sessionId)
Definition SequencedFrame.hpp:181
std::uint16_t version
payload messageHeader version; 0 on a system frame
Definition SequencedFrame.hpp:189
std::uint16_t systemEventType
which of §7's eighteen events; 0 on an application frame
Definition SequencedFrame.hpp:186
bool system
true: a system frame, named by systemEventType, and payloadId means nothing
Definition SequencedFrame.hpp:184
std::int64_t groupSeqNo
this frame's place on its queue: 1 for the first, then one per frame (F-6)
Definition SequencedFrame.hpp:177
std::uint64_t payloadLength
total byte count
Definition SequencedFrame.hpp:192
std::int64_t receiveTimeNs
wall-clock ns at receipt by this client
Definition SequencedFrame.hpp:183
std::int64_t clusterTimestampNs
cluster consensus time (epoch ns) when message was committed
Definition SequencedFrame.hpp:182
std::int64_t position
recording/stream position of this frame's first byte; pass to ReplayParams::position() to replay from...
Definition SequencedFrame.hpp:193
const char * payload
the payload's own bytes, its 8-byte messageHeader included; on a system frame, the message with no fr...
Definition SequencedFrame.hpp:190
std::uint16_t payloadId
which protocol templateId belongs to; 0 on a system frame
Definition SequencedFrame.hpp:185
std::int32_t connectionId
Connection id at that producer; routes the reply (header.connectionId)
Definition SequencedFrame.hpp:179
std::uint16_t groupMask
the groups whose queues carry it (header.groupMask); 0 on a system frame
Definition SequencedFrame.hpp:180
std::int64_t clusterSeqNo
Definition SequencedFrame.hpp:176