Skip to content

Commit e8b3979

Browse files
committed
Remove deprecated Doppler recentLogs and LogsRequest for 6.x
Remove DopplerClient.recentLogs(), RecentLogsRequest, Applications.logs(LogsRequest), and LogsRequest — all deprecated in 5.x (cloudfoundry#1348). Inline the Doppler streaming path directly into logs(ApplicationLogsRequest). Update README with breaking changes.
1 parent e29d8b1 commit e8b3979

File tree

14 files changed

+61
-21526
lines changed

14 files changed

+61
-21526
lines changed

README.md

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,29 @@ The `cf-java-client` project is a Java language binding for interacting with a C
1717
## Versions
1818
The Cloud Foundry Java Client has two active versions. The `5.x` line is compatible with Spring Boot `2.4.x - 2.6.x` just to manage its dependencies, while the `4.x` line uses Spring Boot `2.3.x`.
1919

20-
## Deprecations
21-
22-
### `DopplerClient.recentLogs()` — Recent Logs via Doppler
23-
24-
> [!WARNING]
25-
> **Deprecated since cf-java-client `5.17.x`**
26-
>
27-
> The `DopplerClient.recentLogs()` endpoint (and the related `RecentLogsRequest` / `LogMessage` types from the `org.cloudfoundry.doppler` package) are **deprecated** and will be removed in a future release.
28-
>
29-
> This API relies on the [Loggregator][loggregator] Doppler/Traffic Controller endpoint `/apps/{id}/recentlogs`, which was removed in **Loggregator ≥ 107.0**.
30-
> The affected platform versions are:
31-
>
32-
> | Platform | Last version with Doppler recent-logs support |
33-
> | -------- | --------------------------------------------- |
34-
> | CF Deployment (CFD) | `< 24.3` |
35-
> | Tanzu Application Service (TAS) | `< 4.0` |
36-
>
37-
> **Migration:** Replace any call to `DopplerClient.recentLogs()` with [`LogCacheClient.read()`][log-cache-api] (available via `org.cloudfoundry.logcache.v1.LogCacheClient`).
38-
>
39-
> ```java
40-
> // Before (deprecated)
41-
> dopplerClient.recentLogs(RecentLogsRequest.builder()
42-
> .applicationId(appId)
43-
> .build());
44-
>
45-
> // After
46-
> logCacheClient.read(ReadRequest.builder()
47-
> .sourceId(appId)
48-
> .envelopeTypes(EnvelopeType.LOG)
49-
> .build());
50-
> ```
20+
## Breaking Changes (6.x)
5121

52-
> [!NOTE]
53-
> **Operations API users:** `Applications.logs(ApplicationLogsRequest)` now uses Log Cache under the hood for recent logs (the default). No migration is needed at the Operations layer.
22+
### `DopplerClient.recentLogs()` — Removed
23+
24+
The `DopplerClient.recentLogs()` endpoint (and the `RecentLogsRequest` type) have been **removed**.
25+
This API relied on the [Loggregator][loggregator] Doppler/Traffic Controller endpoint `/apps/{id}/recentlogs`, which was removed in **Loggregator >= 107.0** (CF Deployment >= 24.3, TAS >= 4.0).
26+
27+
**Migration:** Replace calls to `DopplerClient.recentLogs()` with [`LogCacheClient.read()`][log-cache-api]:
28+
29+
```java
30+
logCacheClient.read(ReadRequest.builder()
31+
.sourceId(appId)
32+
.envelopeTypes(EnvelopeType.LOG)
33+
.build());
34+
```
35+
36+
**Operations API users:** Use `Applications.logs(ApplicationLogsRequest)` instead of the removed `Applications.logs(LogsRequest)`.
37+
38+
### `Applications.logs(LogsRequest)` — Removed
39+
40+
The `Applications.logs(LogsRequest)` method (and the `LogsRequest` type) have been **removed**.
41+
42+
**Migration:** Use `Applications.logs(ApplicationLogsRequest)` instead. For recent logs, set `recent(true)` (the default). For streaming, set `recent(false)`.
5443

5544
[loggregator]: https://github.com/cloudfoundry/loggregator
5645
[log-cache-api]: https://github.com/cloudfoundry/log-cache

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/ReactorDopplerEndpoints.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.cloudfoundry.doppler.ContainerMetricsRequest;
2323
import org.cloudfoundry.doppler.Envelope;
2424
import org.cloudfoundry.doppler.FirehoseRequest;
25-
import org.cloudfoundry.doppler.RecentLogsRequest;
2625
import org.cloudfoundry.doppler.StreamRequest;
2726
import org.cloudfoundry.reactor.ConnectionContext;
2827
import org.cloudfoundry.reactor.TokenProvider;
@@ -57,17 +56,6 @@ Flux<Envelope> firehose(FirehoseRequest request) {
5756
.checkpoint();
5857
}
5958

60-
Flux<Envelope> recentLogs(RecentLogsRequest request) {
61-
return get(
62-
builder ->
63-
builder.pathSegment(
64-
"apps", request.getApplicationId(), "recentlogs"),
65-
MultipartCodec::createDecoder,
66-
MultipartCodec::decode)
67-
.map(ReactorDopplerEndpoints::toEnvelope)
68-
.checkpoint();
69-
}
70-
7159
Flux<Envelope> stream(StreamRequest request) {
7260
return ws(builder -> builder.pathSegment("apps", request.getApplicationId(), "stream"))
7361
.map(ReactorDopplerEndpoints::toEnvelope)

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/doppler/_ReactorDopplerClient.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.cloudfoundry.doppler.DopplerClient;
2121
import org.cloudfoundry.doppler.Envelope;
2222
import org.cloudfoundry.doppler.FirehoseRequest;
23-
import org.cloudfoundry.doppler.RecentLogsRequest;
23+
2424
import org.cloudfoundry.doppler.StreamRequest;
2525
import org.cloudfoundry.reactor.ConnectionContext;
2626
import org.cloudfoundry.reactor.TokenProvider;
@@ -47,11 +47,6 @@ public Flux<Envelope> firehose(FirehoseRequest request) {
4747
return getDopplerEndpoints().firehose(request);
4848
}
4949

50-
@Override
51-
public Flux<Envelope> recentLogs(RecentLogsRequest request) {
52-
return getDopplerEndpoints().recentLogs(request);
53-
}
54-
5550
@Override
5651
public Flux<Envelope> stream(StreamRequest request) {
5752
return getDopplerEndpoints().stream(request);

cloudfoundry-client-reactor/src/test/java/org/cloudfoundry/reactor/doppler/ReactorDopplerClientTest.java

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
import org.cloudfoundry.doppler.ContainerMetricsRequest;
2626
import org.cloudfoundry.doppler.Envelope;
2727
import org.cloudfoundry.doppler.EventType;
28-
import org.cloudfoundry.doppler.LogMessage;
29-
import org.cloudfoundry.doppler.MessageType;
30-
import org.cloudfoundry.doppler.RecentLogsRequest;
3128
import org.cloudfoundry.reactor.InteractionContext;
3229
import org.cloudfoundry.reactor.TestRequest;
3330
import org.cloudfoundry.reactor.TestResponse;
@@ -137,108 +134,4 @@ void containerMetricsLarge() {
137134
.expectComplete()
138135
.verify(Duration.ofSeconds(5));
139136
}
140-
141-
@Test
142-
void recentLogs() {
143-
mockRequest(
144-
InteractionContext.builder()
145-
.request(
146-
TestRequest.builder()
147-
.method(GET)
148-
.path("/apps/test-application-id/recentlogs")
149-
.build())
150-
.response(
151-
TestResponse.builder()
152-
.status(OK)
153-
.contentType(
154-
"multipart/x-protobuf;"
155-
+ " boundary=92d42123ec83c0af6a27ba0de34528b702a53e2e67ba99636286b6a4cafb")
156-
.payload(
157-
"fixtures/doppler/apps/GET_{id}_recentlogs_response.bin")
158-
.build())
159-
.build());
160-
161-
this.dopplerEndpoints
162-
.recentLogs(
163-
RecentLogsRequest.builder().applicationId("test-application-id").build())
164-
.as(StepVerifier::create)
165-
.expectNext(
166-
Envelope.builder()
167-
.deployment("cf-cfapps-io2-diego")
168-
.eventType(EventType.LOG_MESSAGE)
169-
.index("33")
170-
.ip("10.10.115.68")
171-
.job("cell_z2")
172-
.logMessage(
173-
LogMessage.builder()
174-
.applicationId(
175-
"1a95eadc-95c6-4675-aa07-8c02f80ea8a4")
176-
.message(
177-
"2016-04-21 22:36:28.035 INFO 24 --- [ "
178-
+ " main]"
179-
+ " o.s.j.e.a.AnnotationMBeanExporter "
180-
+ " : Located managed bean"
181-
+ " 'rabbitConnectionFactory':"
182-
+ " registering with JMX server as"
183-
+ " MBean"
184-
+ " [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory]")
185-
.messageType(MessageType.OUT)
186-
.sourceInstance("0")
187-
.sourceType("APP")
188-
.timestamp(1461278188035928339L)
189-
.build())
190-
.origin("rep")
191-
.timestamp(1461278188035930425L)
192-
.build(),
193-
Envelope.builder()
194-
.deployment("cf-cfapps-io2-diego")
195-
.eventType(EventType.LOG_MESSAGE)
196-
.index("33")
197-
.ip("10.10.115.68")
198-
.job("cell_z2")
199-
.logMessage(
200-
LogMessage.builder()
201-
.applicationId(
202-
"1a95eadc-95c6-4675-aa07-8c02f80ea8a4")
203-
.message("Container became healthy")
204-
.messageType(MessageType.OUT)
205-
.sourceInstance("0")
206-
.sourceType("CELL")
207-
.timestamp(1461278188715651492L)
208-
.build())
209-
.origin("rep")
210-
.timestamp(1461278188715653514L)
211-
.build())
212-
.expectComplete()
213-
.verify(Duration.ofSeconds(5));
214-
}
215-
216-
@Test
217-
void recentLogsLarge() {
218-
mockRequest(
219-
InteractionContext.builder()
220-
.request(
221-
TestRequest.builder()
222-
.method(GET)
223-
.path("/apps/test-application-id/recentlogs")
224-
.build())
225-
.response(
226-
TestResponse.builder()
227-
.status(OK)
228-
.contentType(
229-
"multipart/x-protobuf;"
230-
+ " boundary=74684f6bed3ee99aa98a13c609c354cd849b01a6e6051226906140ad31b2")
231-
.payload(
232-
"fixtures/doppler/apps/GET_{id}_recentlogs_response-large.bin")
233-
.build())
234-
.build());
235-
236-
this.dopplerEndpoints
237-
.recentLogs(
238-
RecentLogsRequest.builder().applicationId("test-application-id").build())
239-
.as(StepVerifier::create)
240-
.expectNextCount(3093)
241-
.expectComplete()
242-
.verify(Duration.ofSeconds(5));
243-
}
244137
}

0 commit comments

Comments
 (0)