Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/io/nats/client/ErrorListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <dt>Fast Producers</dt>
* <dd>One of the connections producers is too fast, and is discarding messages</dd>
* </dl>
* <p>All of these problems are reported to the application code using the ErrorListener. The
* <p>All of these problems are reported to the application code using the ErrorListener. The
* listener is configured in the {@link Options Options} at creation time.
*/
public interface ErrorListener {
Expand All @@ -49,7 +49,7 @@ public interface ErrorListener {
* during Dispatcher callbacks, IOExceptions from the underlying socket, etc..
* The library will try to handle these, via reconnect or catching them, but they are
* forwarded here in case the application code needs them for debugging purposes.
*
*
* @param conn The connection associated with the error
* @param exp The exception that has occurred, and was handled by the library
*/
Expand All @@ -59,13 +59,13 @@ public interface ErrorListener {
* Called by the connection when a &quot;slow&quot; consumer is detected. This call is only made once
* until the consumer stops being slow. At which point it will be called again if the consumer starts
* being slow again.
*
* <p>See {@link Consumer#setPendingLimits(long, long) Consumer.setPendingLimits}
*
* <p>See {@link Consumer#setPendingLimits(long, long) Consumer.setPendingLimits}
* for information on how to configure when this method is fired.
*
*
* <p> Slow consumers will result in dropped messages each consumer provides a method
* for retrieving the count of dropped messages, see {@link Consumer#getDroppedCount() Consumer.getDroppedCount}.
*
*
* @param conn The connection associated with the error
* @param consumer The consumer that is being marked slow
*/
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/io/nats/client/JetStreamSubscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public interface JetStreamSubscription extends Subscription {
*/
String getConsumerName();

/**
* Gets the stream name associated with the subscription.
* @return the stream name
*/
default String getStreamName() { return null; }

/**
* Initiate pull with the specified batch size.
* ! Pull subscriptions only. Push subscription will throw IllegalStateException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public String getConsumerName() {
return consumerName;
}

String getStream() {
@Override
public String getStreamName() {
return stream;
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/nats/client/impl/JetStreamTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public NatsMessage getTestMessage(String replyTo) {

public NatsMessage getTestMessage(String replyTo, String sid) {
return new IncomingMessageFactory(sid, "subj", replyTo, 0, false).getMessage();
}
}

// ----------------------------------------------------------------------------------------------------
// Management
Expand Down Expand Up @@ -349,7 +349,7 @@ public static void validateRead(int expectedRed, int actualRed) {

public static void assertSubscription(JetStreamSubscription sub, String stream, String consumer, String deliver, boolean isPullMode) {
NatsJetStreamSubscription njssub = (NatsJetStreamSubscription)sub;
assertEquals(stream, njssub.getStream());
assertEquals(stream, njssub.getStreamName());
if (consumer == null) {
assertNotNull(njssub.getConsumerName());
}
Expand Down
Loading