Skip to content

Commit eef1874

Browse files
committed
Allow SeqIndexSync and ThrottleConfiguration to act as liveness indicators
1 parent 82be913 commit eef1874

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

artio-core/src/main/java/uk/co/real_logic/artio/protocol/EngineProtocolSubscription.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,16 @@ private Action onSeqIndexSync(
141141
final SeqIndexSyncDecoder seqIndexSync = this.seqIndexSync;
142142
seqIndexSync.wrap(buffer, offset, blockLength, version);
143143

144+
final int libraryId = seqIndexSync.libraryId();
145+
final Action action = handler.onApplicationHeartbeat(
146+
libraryId, header.sessionId(), SeqIndexSyncDecoder.TEMPLATE_ID, 0);
147+
if (action != null)
148+
{
149+
return action; // Continue processing messages, but not this message.
150+
}
151+
144152
return handler.onSeqIndexSync(
145-
seqIndexSync.libraryId(),
153+
libraryId,
146154
seqIndexSync.sessionId(),
147155
seqIndexSync.sequenceIndex());
148156
}
@@ -153,8 +161,16 @@ private Action onThrottleConfiguration(
153161
final ThrottleConfigurationDecoder throttleConfiguration = this.throttleConfiguration;
154162
throttleConfiguration.wrap(buffer, offset, blockLength, version);
155163

164+
final int libraryId = throttleConfiguration.libraryId();
165+
final Action action = handler.onApplicationHeartbeat(
166+
libraryId, header.sessionId(), ThrottleConfigurationDecoder.TEMPLATE_ID, 0);
167+
if (action != null)
168+
{
169+
return action; // Continue processing messages, but not this message.
170+
}
171+
156172
return handler.onThrottleConfiguration(
157-
throttleConfiguration.libraryId(),
173+
libraryId,
158174
throttleConfiguration.correlationId(),
159175
throttleConfiguration.session(),
160176
throttleConfiguration.throttleWindowInMs(),

0 commit comments

Comments
 (0)