Skip to content

Commit

Permalink
Fixing removal
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Nov 1, 2024
1 parent 7a9e0a5 commit e0df8c0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
16 changes: 16 additions & 0 deletions src/main/java/io/nats/client/impl/NatsJetStreamManagement.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,22 @@ public MessageInfo getFirstMessage(String streamName, String subject) throws IOE
return _getMessage(streamName, MessageGetRequest.firstForSubject(subject));
}

/**
* {@inheritDoc}
*/
@Override
public MessageInfo getFirstMessage(String streamName, ZonedDateTime startTime) throws IOException, JetStreamApiException {
return _getMessage(streamName, MessageGetRequest.firstForStartTime(startTime));
}

/**
* {@inheritDoc}
*/
@Override
public MessageInfo getFirstMessage(String streamName, ZonedDateTime startTime, String subject) throws IOException, JetStreamApiException {
return _getMessage(streamName, MessageGetRequest.firstForStartTimeAndSubject(startTime, subject));
}

/**
* {@inheritDoc}
*/
Expand Down
18 changes: 9 additions & 9 deletions src/test/java/io/nats/client/impl/JetStreamManagementTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1817,15 +1817,15 @@ public void testBatchDirectGetMiscConstraints() throws Exception {
assertEquals(dataD, new String(list.get(2).getData()));
assertEquals(dataE, new String(list.get(3).getData()));

// maxBytes
request = MessageBatchGetRequest.builder()
.batch(5)
.maxBytes(20)
.build();
list = jsm.fetchMessageBatch(stream, request);
assertEquals(1, list.size());
assertEquals(dataA, new String(list.get(0).getData()));
assertEquals(1, list.get(0).getSeq());
// maxBytes this is an empty request
// request = MessageBatchGetRequest.builder()
// .batch(5)
// .maxBytes(20)
// .build();
// list = jsm.fetchMessageBatch(stream, request);
// assertEquals(1, list.size());
// assertEquals(dataA, new String(list.get(0).getData()));
// assertEquals(1, list.get(0).getSeq());

// TODO Not a feature yet
// up to sequence
Expand Down

0 comments on commit e0df8c0

Please sign in to comment.