Conversation
ZPascal
force-pushed
the
add-log-cache-log-streaming-support
branch
from
March 7, 2026 14:43
606817f to
08fb796
Compare
ZPascal
force-pushed
the
add-log-cache-log-streaming-support
branch
5 times, most recently
from
June 9, 2026 15:54
4e11f4c to
b0ce71f
Compare
ZPascal
marked this pull request as ready for review
June 9, 2026 15:55
ZPascal
marked this pull request as draft
June 9, 2026 15:55
ZPascal
force-pushed
the
add-log-cache-log-streaming-support
branch
2 times, most recently
from
June 10, 2026 04:27
400d808 to
9105a92
Compare
ZPascal
force-pushed
the
add-log-cache-log-streaming-support
branch
from
June 10, 2026 05:28
9105a92 to
06acac7
Compare
Signed-off-by: I539231 <pascal.zimmermann01@sap.com>
ZPascal
marked this pull request as ready for review
June 17, 2026 16:00
Lokowandtg
requested changes
Jul 15, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds live log streaming via Log Cache — the Java equivalent of
cf tail --follow.Previously the only Log Cache read path was
logsRecent, a single snapshot request. There was no way to continuously receive new log envelopes without polling manually. This change introduces alogsTailAPI across all three relevant modules.Motivation
Cloud Foundry dropped the legacy Loggregator Doppler streaming endpoint (
DopplerClient.stream()) in Loggregator ≥ 107.0 (CFD ≥ 24.3 / TAS ≥ 4.0). The CF CLI replaced it with a polling loop over the Log Cache/api/v1/readendpoint — that is whatcf tail --followdoes today. This PR brings the same capability to Java consumers.Changes
Changes in detail
cloudfoundry-client— newTailLogsRequestandLogCacheClient.logsTail()New
_TailLogsRequest.java(Immutables@Value.Immutable):sourceIdStringstartTimeLong(nullable)now − 5 s(ns)envelopeTypesList<EnvelopeType>(nullable)nameFilterString(nullable)pollIntervalDuration250 msNew method on
LogCacheClient:cloudfoundry-client-reactor— non-blocking polling implementationReactorLogCacheEndpoints.logsTail()mirrors the Go logcache.Walk() algorithm, fully non-blocking:AtomicLongcursor starts atstartTime(ornow − 5 s).Flux.deferbuilds a freshReadRequestfrom the current cursor on every repetition and callsGET /api/v1/read/{sourceId}?start_time=cursor.lastTimestamp + 1; each envelope is emitted individually downstream.repeatWheninserts aMono.delay(pollInterval)before the next poll. When envelopes arrive, the next poll starts immediately.Fluxis infinite; the caller cancels the subscription to stop.Transient network errors are logged and retried. HTTP errors (4xx/5xx) are propagated to the subscriber.
cloudfoundry-operations—Applications.logsTail()DefaultApplicationsdelegates toLogCacheClient:Tests
logsTailLogCacheLOG/OUTenvelope is forwarded correctlylogsTailLogCacheMultipleEnvelopesOUT → ERR → OUTare emitted in orderlogsTailLogCacheErrorRuntimeExceptionfrom the client propagates unchanged to the subscriberlogsTailLogCacheOutAndErrEnvelopesUsage
Or via the Operations API:
Relation to existing API
DopplerClient.stream()LogCacheClient.recentLogs()LogCacheClient.logsTail()✅ newChecklist
_TailLogsRequestImmutables value objectLogCacheClient.logsTail()interface methodReactorLogCacheEndpoints.logsTail()— non-blocking Reactor implementation_ReactorLogCacheClient.logsTail()— delegate overrideApplications.logsTail()— Operations API methodDefaultApplications.logsTail()— implementationDefaultApplicationsTest(120 passing)