Skip to content

Commit fa79e86

Browse files
committed
Update readme
1 parent f956a98 commit fa79e86

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This project started as a fork from https://github.com/PelionIoT/java-coap, but
5050
Runtime requirements
5151
------------
5252

53-
* JRE 8, 11, 17
53+
* JRE 8, 17, 21
5454

5555
Using the Library
5656
-----------------
@@ -65,6 +65,8 @@ dependencies {
6565
implementation("io.github.open-coap:coap-core:VERSION")
6666
implementation("io.github.open-coap:coap-mbedtls:VERSION") // for DTLS support
6767
implementation("io.github.open-coap:coap-tcp:VERSION") // for coap over tcp support
68+
implementation("io.github.open-coap:coap-metrics:VERSION") // for micrometer integration
69+
implementation("io.github.open-coap:coap-netty:VERSION") // for netty integration
6870
}
6971
```
7072

@@ -111,7 +113,7 @@ client = CoapServer.builder()
111113
return true; // return false to terminate observation
112114
})
113115
// (optional) set custom observation relation store, for example one that will use external storage
114-
.observationRelationsStore(new HashMapObservationRelations())
116+
.observationsStore(new HashMapObservationsStore())
115117
// (optional) define maximum block size
116118
.blockSize(BlockSize.S_1024)
117119
// (optional) set maximum response timeout, default for every request
@@ -164,7 +166,7 @@ client.close();
164166

165167
```java
166168
// define subscription manager for observable resources
167-
InboundSubscriptionManager subscriptionManager = new InboundSubscriptionManager();
169+
ObserversManager observersManager = new ObserversManager();
168170

169171
server = CoapServer.builder()
170172
// configure with plain text UDP transport, listening on port 5683
@@ -180,13 +182,13 @@ server = CoapServer.builder()
180182
return coapResponse(Code.C204_CHANGED).toFuture();
181183
})
182184
// observable resource
183-
.get("/sensors/temperature", subscriptionManager.then(req ->
184-
completedFuture(CoapResponse.ok("21C"))
185+
.get("/sensors/temperature", observersManager.then(req ->
186+
CoapResponse.ok("21C").toFuture()
185187
))
186188
)
187189
.build();
188190

189-
subscriptionManager.init(server);
191+
observersManager.init(server);
190192
server.start();
191193
```
192194

0 commit comments

Comments
 (0)