diff --git a/nats/src/main/java/io/micronaut/nats/connect/ConsumerLimits.java b/nats/src/main/java/io/micronaut/nats/connect/ConsumerLimits.java index 1128c633..794146c3 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/ConsumerLimits.java +++ b/nats/src/main/java/io/micronaut/nats/connect/ConsumerLimits.java @@ -40,14 +40,6 @@ io.nats.client.api.ConsumerLimits build() { .build(); } - /** - * Inactive threshold. - * @return duration - */ - public Duration getInactiveThreshold() { - return inactiveThreshold; - } - /** * Inactive threshold. * @param inactiveThreshold {@link Duration} @@ -56,14 +48,6 @@ public void setInactiveThreshold(Duration inactiveThreshold) { this.inactiveThreshold = inactiveThreshold; } - /** - * Maximal acknowledgments pending. - * @return maxAckPending - */ - public Long getMaxAckPending() { - return maxAckPending; - } - /** * Maximal acknowledgments pending. * @param maxAckPending {@link Long} diff --git a/nats/src/main/java/io/micronaut/nats/connect/Mirror.java b/nats/src/main/java/io/micronaut/nats/connect/Mirror.java index 3be88334..703548f5 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/Mirror.java +++ b/nats/src/main/java/io/micronaut/nats/connect/Mirror.java @@ -32,14 +32,14 @@ public abstract class Mirror addresses) { this.addresses = addresses; } - /** - * @return the username for the connection - */ - public Optional getUsername() { - return Optional.ofNullable(username); - } - /** * @param username the username */ @@ -141,13 +134,6 @@ public void setUsername(@Nullable String username) { this.username = username; } - /** - * @return the password for the connection - */ - public Optional getPassword() { - return Optional.ofNullable(password); - } - /** * @param password the password */ @@ -155,13 +141,6 @@ public void setPassword(@Nullable String password) { this.password = password; } - /** - * @return the token for the connection - */ - public Optional getToken() { - return Optional.ofNullable(token); - } - /** * @param token the token */ @@ -169,13 +148,6 @@ public void setToken(String token) { this.token = token; } - /** - * @return the max reconnection tries - */ - public int getMaxReconnect() { - return maxReconnect; - } - /** * @param maxReconnect times to try reconnect */ @@ -183,13 +155,6 @@ public void setMaxReconnect(int maxReconnect) { this.maxReconnect = maxReconnect; } - /** - * @return time to wait between reconnect attempts - */ - public Duration getReconnectWait() { - return reconnectWait; - } - /** * @param reconnectWait time to wait */ @@ -197,13 +162,6 @@ public void setReconnectWait(Duration reconnectWait) { this.reconnectWait = reconnectWait; } - /** - * @return maximum time for initial connection - */ - public Duration getConnectionTimeout() { - return connectionTimeout; - } - /** * @param connectionTimeout maximumTime for inital connection */ @@ -211,13 +169,6 @@ public void setConnectionTimeout(Duration connectionTimeout) { this.connectionTimeout = connectionTimeout; } - /** - * @return time between ping intervals - */ - public Duration getPingInterval() { - return pingInterval; - } - /** * @param pingInterval time between server pings */ @@ -225,13 +176,6 @@ public void setPingInterval(Duration pingInterval) { this.pingInterval = pingInterval; } - /** - * @return size of the buffer, in bytes, used to store publish messages during reconnect - */ - public long getReconnectBufferSize() { - return reconnectBufferSize; - } - /** * @param reconnectBufferSize size of the buffer, in bytes, used to store publish messages during reconnect */ @@ -239,13 +183,6 @@ public void setReconnectBufferSize(long reconnectBufferSize) { this.reconnectBufferSize = reconnectBufferSize; } - /** - * @return prefix to use for request/reply inboxes - */ - public String getInboxPrefix() { - return inboxPrefix; - } - /** * @param inboxPrefix custom prefix for request/reply inboxes */ @@ -253,13 +190,6 @@ public void setInboxPrefix(String inboxPrefix) { this.inboxPrefix = inboxPrefix; } - /** - * @return whether or not to block echo messages, messages that were sent by this connection - */ - public boolean isNoEcho() { - return noEcho; - } - /** * @param noEcho enable or disable echo messages, messages that are sent by this connection back to this connection */ @@ -267,13 +197,6 @@ public void setNoEcho(boolean noEcho) { this.noEcho = noEcho; } - /** - * @return whether or not the client should support for UTF8 subject names - */ - public boolean isUtf8Support() { - return utf8Support; - } - /** * @param utf8Support whether or not the client should support for UTF8 subject names */ @@ -281,13 +204,6 @@ public void setUtf8Support(boolean utf8Support) { this.utf8Support = utf8Support; } - /** - * @return path to the credentials file to use for authentication with an account enabled server - */ - public String getCredentials() { - return credentials; - } - /** * @param credentials path to the credentials file to use for authentication with an account enabled server */ @@ -375,13 +291,6 @@ public static class TLS { private String certificatePath; - /** - * @return file path for the trust store - */ - public String getTrustStorePath() { - return this.trustStorePath; - } - /** * @param trustStorePath file path for the trust store */ @@ -389,13 +298,6 @@ public void setTrustStorePath(String trustStorePath) { this.trustStorePath = trustStorePath; } - /** - * @return password used to unlock the trust store - */ - public String getTrustStorePassword() { - return this.trustStorePassword; - } - /** * @param trustStorePassword used to unlock the trust store */ @@ -403,13 +305,6 @@ public void setTrustStorePassword(String trustStorePassword) { this.trustStorePassword = trustStorePassword; } - /** - * @return type of keystore to use for connections - */ - public String getTrustStoreType() { - return this.trustStoreType; - } - /** * @param trustStoreType generally the default, but available for special trust store * formats/types @@ -418,13 +313,6 @@ public void setTrustStoreType(@Nullable String trustStoreType) { this.trustStoreType = trustStoreType; } - /** - * @return the certificate path - */ - public String getCertificatePath() { - return certificatePath; - } - /** * @param certificatePath the path to the certificate */ @@ -614,15 +502,6 @@ public io.nats.client.api.StreamConfiguration toStreamConfiguration() { return streamBuilder.build(); } - /** - * get the subjects of the stream. - * - * @return the subjects - */ - public List getSubjects() { - return subjects; - } - /** * set the subjects. * @@ -632,15 +511,6 @@ public void setSubjects(List subjects) { this.subjects = subjects; } - /** - * the Placement. - * - * @return placement - */ - public Placement getPlacement() { - return placement; - } - /** * the Placement. * @@ -650,15 +520,6 @@ public void setPlacement(Placement placement) { this.placement = placement; } - /** - * The Subject Transform. - * - * @return subject transform - */ - public SubjectTransform getSubjectTransform() { - return subjectTransform; - } - /** * The Subject Transform. * @@ -668,15 +529,6 @@ public void setSubjectTransform(SubjectTransform subjectTransform) { this.subjectTransform = subjectTransform; } - /** - * The mirror. - * - * @return mirror - */ - public Mirror getMirror() { - return mirror; - } - /** * The mirror. * @@ -687,16 +539,7 @@ public void setMirror(Mirror mirror) { } /** - * sources. - * - * @return list of sources - */ - public List getSources() { - return sources; - } - - /** - * sources. + * Sources. * * @param sources list of sources */ @@ -704,15 +547,6 @@ public void setSources(List sources) { this.sources = sources; } - /** - * Republish. - * - * @return republish - */ - public Republish getRepublish() { - return republish; - } - /** * Republish. * @@ -722,15 +556,6 @@ public void setRepublish(Republish republish) { this.republish = republish; } - /** - * Consumer Limits. - * - * @return the limits - */ - public ConsumerLimits getConsumerLimits() { - return consumerLimits; - } - /** * Consumer Limits. * @param consumerLimits {@link ConsumerLimits} @@ -900,15 +725,6 @@ public io.nats.client.api.KeyValueConfiguration toKeyValueConfiguration() { return keyValueBuilder.build(); } - /** - * the Placement. - * - * @return placement - */ - public Placement getPlacement() { - return placement; - } - /** * the Placement. * @@ -918,15 +734,6 @@ public void setPlacement(Placement placement) { this.placement = placement; } - /** - * The mirror. - * - * @return mirror - */ - public Mirror getMirror() { - return mirror; - } - /** * The mirror. * @@ -936,15 +743,6 @@ public void setMirror(Mirror mirror) { this.mirror = mirror; } - /** - * sources. - * - * @return list of sources - */ - public List getSources() { - return sources; - } - /** * sources. * @@ -954,15 +752,6 @@ public void setSources(List sources) { this.sources = sources; } - /** - * Republish. - * - * @return republish - */ - public Republish getRepublish() { - return republish; - } - /** * Republish. * @@ -1084,15 +873,6 @@ public io.nats.client.api.ObjectStoreConfiguration.Builder getBuilder() { return builder; } - /** - * the Placement. - * - * @return placement - */ - public Placement getPlacement() { - return placement; - } - /** * the Placement. * diff --git a/nats/src/main/java/io/micronaut/nats/connect/Placement.java b/nats/src/main/java/io/micronaut/nats/connect/Placement.java index f4fa5850..3b74316d 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/Placement.java +++ b/nats/src/main/java/io/micronaut/nats/connect/Placement.java @@ -42,30 +42,14 @@ io.nats.client.api.Placement build() { return io.nats.client.api.Placement.builder().cluster(cluster).tags(tags).build(); } - /** - * Cluster. - * @return cluster - */ - public String getCluster() { - return cluster; - } - /** * Cluster. * @param cluster {@link String} */ - public void setCluster(String cluster) { + public void setCluster(@NonNull String cluster) { this.cluster = cluster; } - /** - * Tags. - * @return list of tags - */ - public List getTags() { - return tags; - } - /** * Tags. * @param tags List of tags diff --git a/nats/src/main/java/io/micronaut/nats/connect/Republish.java b/nats/src/main/java/io/micronaut/nats/connect/Republish.java index b719695b..2b51a38c 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/Republish.java +++ b/nats/src/main/java/io/micronaut/nats/connect/Republish.java @@ -46,51 +46,24 @@ io.nats.client.api.Republish build() { .build(); } - /** - * Source. - * - * @return source - */ - public String getSource() { - return source; - } - /** * Source. * * @param source {@link String} */ - public void setSource(String source) { + public void setSource(@NonNull String source) { this.source = source; } - /** - * Destination. - * - * @return destination - */ - public String getDestination() { - return destination; - } - /** * Destination. * * @param destination {@link String} */ - public void setDestination(String destination) { + public void setDestination(@NonNull String destination) { this.destination = destination; } - /** - * HeadersOnly. - * - * @return headersOnly - */ - public boolean isHeadersOnly() { - return headersOnly; - } - /** * HeadersOnly. * diff --git a/nats/src/main/java/io/micronaut/nats/connect/Source.java b/nats/src/main/java/io/micronaut/nats/connect/Source.java index 5bb21ffd..6499bdc7 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/Source.java +++ b/nats/src/main/java/io/micronaut/nats/connect/Source.java @@ -32,14 +32,14 @@ public abstract class Source { - private String name; - private long startSeq = 0; - private ZonedDateTime startTime; - private String filterSubject; - private E external; - private List subjectTransforms = new ArrayList<>(); + protected String name; + protected long startSeq = 0; + protected ZonedDateTime startTime; + protected String filterSubject; + protected E external; + protected List subjectTransforms = new ArrayList<>(); - /** - * Name. - * @return name - */ - public String getName() { - return name; - } /** * Name. @@ -47,14 +40,6 @@ public void setName(String name) { this.name = name; } - /** - * Start sequence. - * @return startSeq - */ - public long getStartSeq() { - return startSeq; - } - /** * Start sequence. * @param startSeq long @@ -63,14 +48,6 @@ public void setStartSeq(long startSeq) { this.startSeq = startSeq; } - /** - * Start time. - * @return start time. - */ - public ZonedDateTime getStartTime() { - return startTime; - } - /** * Start time. * @param startTime {@link ZonedDateTime} @@ -79,14 +56,6 @@ public void setStartTime(ZonedDateTime startTime) { this.startTime = startTime; } - /** - * Filter subject. - * @return filterSubject - */ - public String getFilterSubject() { - return filterSubject; - } - /** * Filter subject. * @param filterSubject {@link String} @@ -95,14 +64,6 @@ public void setFilterSubject(String filterSubject) { this.filterSubject = filterSubject; } - /** - * Subject transformations. - * @return subjectTransforms - */ - public List getSubjectTransforms() { - return subjectTransforms; - } - /** * Subject transformations. * @param subjectTransforms list @@ -111,14 +72,6 @@ public void setSubjectTransforms(@NonNull List subjectTransforms) { this.subjectTransforms = subjectTransforms; } - /** - * External. - * @return external - */ - public E getExternal() { - return external; - } - /** * External. * @param external {@link External} @@ -146,14 +99,6 @@ public io.nats.client.api.External build() { return io.nats.client.api.External.builder().api(api).deliver(deliver).build(); } - /** - * Api. - * @return api - */ - public String getApi() { - return api; - } - /** * Api. * @param api {@link String} @@ -162,14 +107,6 @@ public void setApi(String api) { this.api = api; } - /** - * Deliver. - * @return deliver - */ - public String getDeliver() { - return deliver; - } - /** * Deliver. * @param deliver {@link String} diff --git a/nats/src/main/java/io/micronaut/nats/connect/SubjectTransformBase.java b/nats/src/main/java/io/micronaut/nats/connect/SubjectTransformBase.java index 88106b25..ce2dbca1 100644 --- a/nats/src/main/java/io/micronaut/nats/connect/SubjectTransformBase.java +++ b/nats/src/main/java/io/micronaut/nats/connect/SubjectTransformBase.java @@ -36,14 +36,6 @@ SubjectTransform build() { return SubjectTransform.builder().source(source).destination(destination).build(); } - /** - * Source. - * @return source - */ - public String getSource() { - return source; - } - /** * Source. * @param source {@link String} @@ -52,14 +44,6 @@ public void setSource(String source) { this.source = source; } - /** - * Destination. - * @return destination - */ - public String getDestination() { - return destination; - } - /** * Destination. * @param destination {@link String} diff --git a/nats/src/main/java/io/micronaut/nats/jetstream/annotation/PushConsumer.java b/nats/src/main/java/io/micronaut/nats/jetstream/annotation/PushConsumer.java index fcb750df..7de12cc4 100644 --- a/nats/src/main/java/io/micronaut/nats/jetstream/annotation/PushConsumer.java +++ b/nats/src/main/java/io/micronaut/nats/jetstream/annotation/PushConsumer.java @@ -110,9 +110,8 @@ * @return the filter subject * @see io.nats.client.api.ConsumerConfiguration.Builder#filterSubject(String) * @deprecated migrate to the filterSubjects property - * @since 4.1.0 */ - @Deprecated + @Deprecated(since = "4.1.0") String filterSubject() default ""; /** diff --git a/nats/src/test/groovy/io/micronaut/nats/jetstream/AbstractJetstreamTest.groovy b/nats/src/test/groovy/io/micronaut/nats/jetstream/AbstractJetstreamTest.groovy index d31c253f..74b1821e 100644 --- a/nats/src/test/groovy/io/micronaut/nats/jetstream/AbstractJetstreamTest.groovy +++ b/nats/src/test/groovy/io/micronaut/nats/jetstream/AbstractJetstreamTest.groovy @@ -42,6 +42,8 @@ abstract class AbstractJetstreamTest extends Specification { "spec.name" : getClass().simpleName, "nats.default.jetstream.streams.widgets.storage-type": "Memory", "nats.default.jetstream.streams.widgets.subjects": ['subject.>'], + "nats.default.jetstream.streams.widgets.consumer-limits.inactive-threshold": "10m", + "nats.default.jetstream.streams.widgets.consumer-limits.max-ack-pending": "-1", "nats.default.jetstream.keyvalue.examplebucket.storage-type": "Memory", "nats.default.jetstream.keyvalue.examplebucket.max-history-per-key": 5, "nats.default.jetstream.objectstore.examplestore.storage-type": "Memory"