-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from quarkiverse/feature/consumer-not-found
Create consumer if not exists on nextMessage
- Loading branch information
Showing
6 changed files
with
137 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
release: | ||
current-version: "1.13.1" | ||
current-version: "1.13.2" | ||
next-version: "1.14.0-SNAPSHOT" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
:project-version: 1.13.1 | ||
:project-version: 1.13.2 | ||
|
||
:examples-dir: ./../examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...va/io/quarkiverse/reactive/messaging/nats/jetstream/client/ConsumerNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.quarkiverse.reactive.messaging.nats.jetstream.client; | ||
|
||
public class ConsumerNotFoundException extends RuntimeException { | ||
|
||
public ConsumerNotFoundException(final String stream, final String consumerName) { | ||
super(String.format("Consumer with name = %S not found in stream = %s", consumerName, stream)); | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
.../quarkiverse/reactive/messaging/nats/jetstream/client/vertx/AdministrationConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package io.quarkiverse.reactive.messaging.nats.jetstream.client.vertx; | ||
|
||
import java.util.List; | ||
|
||
import io.nats.client.api.ConsumerInfo; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.ConnectionListener; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.administration.PurgeResult; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.administration.SetupResult; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.administration.StreamState; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.configuration.ConnectionConfiguration; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.configuration.KeyValueSetupConfiguration; | ||
import io.quarkiverse.reactive.messaging.nats.jetstream.client.configuration.SetupConfiguration; | ||
import io.smallrye.mutiny.Uni; | ||
import io.vertx.mutiny.core.Context; | ||
|
||
public class AdministrationConnection | ||
extends io.quarkiverse.reactive.messaging.nats.jetstream.client.administration.AdministrationConnection { | ||
private final Context context; | ||
|
||
public AdministrationConnection(ConnectionConfiguration connectionConfiguration, ConnectionListener connectionListener, | ||
Context context) { | ||
super(connectionConfiguration, connectionListener); | ||
this.context = context; | ||
} | ||
|
||
@Override | ||
public Uni<ConsumerInfo> getConsumerInfo(String stream, String consumerName) { | ||
return super.getConsumerInfo(stream, consumerName) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<List<String>> getStreams() { | ||
return super.getStreams() | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<List<String>> getSubjects(String streamName) { | ||
return super.getSubjects(streamName) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<List<String>> getConsumerNames(String streamName) { | ||
return super.getConsumerNames(streamName) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<PurgeResult> purgeStream(String streamName) { | ||
return super.purgeStream(streamName) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<Void> deleteMessage(String stream, long sequence, boolean erase) { | ||
return super.deleteMessage(stream, sequence, erase) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<StreamState> getStreamState(String streamName) { | ||
return super.getStreamState(streamName) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<List<PurgeResult>> purgeAllStreams() { | ||
return super.purgeAllStreams() | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<SetupResult> addOrUpdateStream(SetupConfiguration setupConfiguration) { | ||
return super.addOrUpdateStream(setupConfiguration) | ||
.emitOn(context::runOnContext); | ||
} | ||
|
||
@Override | ||
public Uni<Void> addOrUpdateKeyValueStore(KeyValueSetupConfiguration keyValueSetupConfiguration) { | ||
return super.addOrUpdateKeyValueStore(keyValueSetupConfiguration) | ||
.emitOn(context::runOnContext); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters