Skip to content

Commit

Permalink
Small improvements README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aaabramov authored Sep 20, 2023
1 parent 6c4a13a commit 68e1979
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ The Java NATS library provides two mechanisms to listen for messages, three if y
## JetStream
Publishing and subscribing to JetStream enabled servers is straightforward. A
JetStream enabled application will connect to a server, establish a JetStream
Publishing and subscribing to JetStream-enabled servers is straightforward. A
JetStream-enabled application will connect to a server, establish a JetStream
context, and then publish or subscribe. This can be mixed and matched with standard
NATS subject, and JetStream subscribers, depending on configuration, receive messages
from both streams and directly from other NATS producers.
Expand Down Expand Up @@ -769,12 +769,12 @@ in the JetStream examples for a detailed and runnable example.
**Iterate:**

```java
Iterator<Message> iter = sub.iterate(100, Duration.ofSeconds(1));
while (iter.hasNext()) {
Message m = iter.next();
// process message
m.ack();
}
Iterator<Message> iter = sub.iterate(100, Duration.ofSeconds(1));
while (iter.hasNext()) {
Message m = iter.next();
// process message
m.ack();
}
```

The iterate method is a *macro* pull that uses advanced pulls under the covers to return an iterator.
Expand Down

0 comments on commit 68e1979

Please sign in to comment.