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
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public class ChaosTestApp {
+ " --stream jchaos-stream"
+ " --subject jchaos-subject"
// + " --runtime 3600 // 1 hour in seconds
+ " --screen left"
// + " --screen left"
// + " --work"
+ " --create"
// + " --r3"
+ " --publish"
+ " --pubjitter 30"
// + " --simple ephemeral,100,5000"
+ " --simple ordered 100 5000"
+ " --simple durable 100 5000" // space or commas work, the parser figures it out
+ " --fetch durable,100,5000"
+ " --push ordered"
+ " --push durable"
// + " --simple durable 100 5000" // space or commas work, the parser figures it out
// + " --fetch durable,100,5000"
// + " --push ordered"
// + " --push durable"
// + " --logdir c:\\temp"
).split(" ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private void usage() {
"----------------------------------------------------------------------------------------------------\n" +
"--servers <natsServerUrl>[,<natsServerUrl>]*\n" +
" * i.e. --servers nats://localhost:4000,nats://localhost:4001,nats://localhost:4002\n" +
" * not supplied uses \"ats://localhost:4222\"\n" +
" * not supplied uses \"nats://localhost:4222\"\n" +
"--stream <stream name>\n" +
" * not supplied uses \"app-stream\"\n" +
"--subject <subject>\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class NatsJsPushSubOrdered {
public static void main(String[] args) {
Options options = Options.builder()
.server(SERVER)
.connectionListener((c, e) -> System.out.println(e.name()))
.errorListener(new ErrorListenerConsoleImpl())
.build();
try (Connection nc = Nats.connect(options)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class OrderedMessageConsumerExample {
public static void main(String[] args) {
Options options = Options.builder()
.server(SERVER)
.connectionListener((c, e) -> System.out.println(e.name()))
.errorListener(new ErrorListenerConsoleImpl())
.build();
try (Connection nc = Nats.connect(options)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void setConsumerName(String consumerName) {

void initSub(NatsJetStreamPullSubscription sub) {
this.sub = sub;
this.consumerName = sub.getConsumerName();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Directly setting the consumer name.

pmm = (PullMessageManager)sub.manager;
}

Expand All @@ -65,7 +66,7 @@ public boolean isFinished() {
*/
@Override
public String getConsumerName() {
if (consumerName == null) {
if (consumerName == null && cachedConsumerInfo != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found the bug when cachedConsumerInfo was null, early in the lifecycle. Fixed the problem above but added the guard anyway.

consumerName = cachedConsumerInfo.getName();
}
return consumerName;
Expand Down
Loading