Skip to content

Commit 3dd104e

Browse files
committed
update readme example
1 parent e99e45b commit 3dd104e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

opamp-client/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ client [spec](https://github.com/open-telemetry/opamp-spec/blob/main/specificati
1111

1212
```java
1313
// Initializing it
14-
1514
RequestService requestService = HttpRequestService.create(OkHttpSender.create("[OPAMP_SERVICE_URL]"));
1615
// RequestService requestService = WebSocketRequestService.create(OkHttpWebSocket.create("[OPAMP_SERVICE_URL]")); // Use this instead to connect to the server via WebSocket.
1716
OpampClient client =
1817
OpampClient.builder()
1918
.putIdentifyingAttribute("service.name", "My service name")
2019
.enableRemoteConfig()
2120
.setRequestService(requestService)
22-
.build(
23-
new OpampClient.Callbacks() {
21+
.build(cx -> new OpampClient.Callbacks() {
2422
@Override
2523
public void onConnect() {}
2624

@@ -37,7 +35,7 @@ OpampClient client =
3735
// A remote config was received
3836

3937
// After applying it...
40-
client.setRemoteConfigStatus(
38+
cx.setRemoteConfigStatus(
4139
new RemoteConfigStatus.Builder()
4240
.status(RemoteConfigStatuses.RemoteConfigStatuses_APPLIED)
4341
.build());

0 commit comments

Comments
 (0)