Skip to content

Commit 0e518b5

Browse files
Apply Palantir Java Format
1 parent 4b33d58 commit 0e518b5

6 files changed

Lines changed: 27 additions & 31 deletions

File tree

rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/internal/NatsProvisioner.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ private String tryFindAndBindStaleConsumer(
243243
}
244244
}
245245
throw new RqueueNatsException(
246-
"Filtered consumer with filter '" + filterSubject + "' not found on stream '"
247-
+ streamName + "' despite 'filtered consumer not unique' error");
246+
"Filtered consumer with filter '" + filterSubject + "' not found on stream '" + streamName
247+
+ "' despite 'filtered consumer not unique' error");
248248
} catch (IOException | JetStreamApiException e) {
249249
throw new RqueueNatsException(
250250
"Failed to recover from 'filtered consumer not unique' error on stream '" + streamName
@@ -272,8 +272,7 @@ private ConsumerInfo safeGetConsumerInfo(String streamName, String consumerName)
272272
return jsm.getConsumerInfo(streamName, consumerName);
273273
} catch (JetStreamApiException e) {
274274
// 10014 = consumer not found, 10059 = stream not found
275-
if (e.getApiErrorCode() == 10014 || e.getApiErrorCode() == 10059
276-
|| e.getErrorCode() == 404) {
275+
if (e.getApiErrorCode() == 10014 || e.getApiErrorCode() == 10059 || e.getErrorCode() == 404) {
277276
return null;
278277
}
279278
throw e;

rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/js/JetStreamMessageBroker.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ public JetStreamMessageBroker build() {
665665
management = connection.jetStreamManagement();
666666
}
667667
if (provisioner == null) {
668-
provisioner = new NatsProvisioner(connection, management, config != null ? config : RqueueNatsConfig.defaults());
668+
provisioner = new NatsProvisioner(
669+
connection, management, config != null ? config : RqueueNatsConfig.defaults());
669670
}
670671
} catch (IOException e) {
671672
throw new RqueueNatsException("Failed to derive JetStream context from connection", e);
@@ -676,7 +677,8 @@ public JetStreamMessageBroker build() {
676677
if (mapper == null) {
677678
mapper = new ObjectMapper();
678679
}
679-
return new JetStreamMessageBroker(connection, jetStream, management, config, mapper, provisioner);
680+
return new JetStreamMessageBroker(
681+
connection, jetStream, management, config, mapper, provisioner);
680682
}
681683

682684
/** Create a broker that wraps a pre-built {@link Map} of NATS handles. Used by the factory. */

rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/kv/NatsKvBuckets.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ public final class NatsKvBuckets {
5353
public static final String QUEUE_STATS = "rqueue-queue-stats";
5454

5555
/** All buckets the NATS backend will use, in stable order. */
56-
public static final List<String> ALL_BUCKETS = Collections.unmodifiableList(
57-
Arrays.asList(QUEUE_CONFIG, JOBS, LOCKS, MESSAGE_METADATA, WORKERS, WORKER_HEARTBEATS,
58-
QUEUE_STATS));
56+
public static final List<String> ALL_BUCKETS = Collections.unmodifiableList(Arrays.asList(
57+
QUEUE_CONFIG, JOBS, LOCKS, MESSAGE_METADATA, WORKERS, WORKER_HEARTBEATS, QUEUE_STATS));
5958

6059
private NatsKvBuckets() {}
6160
}

rqueue-nats/src/main/java/com/github/sonus21/rqueue/nats/repository/NatsMessageBrowsingRepository.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
package com.github.sonus21.rqueue.nats.repository;
1818

1919
import com.github.sonus21.rqueue.exception.BackendCapabilityException;
20-
import com.github.sonus21.rqueue.exception.QueueDoesNotExist;
21-
import com.github.sonus21.rqueue.listener.QueueDetail;
2220
import com.github.sonus21.rqueue.models.enums.DataType;
2321
import com.github.sonus21.rqueue.models.response.DataViewResponse;
2422
import com.github.sonus21.rqueue.nats.RqueueNatsConfig;
25-
import com.github.sonus21.rqueue.nats.RqueueNatsException;
2623
import com.github.sonus21.rqueue.repository.MessageBrowsingRepository;
2724
import io.nats.client.JetStreamApiException;
2825
import io.nats.client.JetStreamManagement;

rqueue-spring-boot-starter/src/main/java/com/github/sonus21/rqueue/spring/boot/RqueueNatsAutoConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import java.io.IOException;
3232
import org.springframework.boot.autoconfigure.AutoConfiguration;
3333
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
34-
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
3534
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3635
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3736
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -170,7 +169,7 @@ public NatsProvisioner natsProvisioner(
170169
return new NatsProvisioner(connection, jetStreamManagement, toBrokerConfig(props));
171170
}
172171

173-
/**
172+
/**
174173
* NATS-side {@link com.github.sonus21.rqueue.repository.MessageBrowsingRepository} powering
175174
* the dashboard's data-explorer and queue-detail panels. Maps Redis-style queue names to
176175
* JetStream streams and returns actual message counts from the broker. JetStream KV doesn't

rqueue-web/src/main/java/com/github/sonus21/rqueue/web/service/impl/RqueueQDetailServiceImpl.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,21 @@ public List<Entry<NavTab, RedisDataDetail>> getQueueDataStructureDetail(QueueCon
170170
String processingQueueName = queueConfig.getProcessingQueueName();
171171
Long running = messageBrowsingRepository.getDataSize(processingQueueName, DataType.ZSET);
172172
// When a non-Redis broker is configured, use its storage display names instead of Redis keys.
173-
String pendingDisplayName = brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
174-
? messageBroker.storageDisplayName(brokerQueueDetail)
175-
: queueConfig.getQueueName();
176-
String runningDisplayName = brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
177-
? messageBroker.storageDisplayName(brokerQueueDetail)
178-
: processingQueueName;
173+
String pendingDisplayName =
174+
brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
175+
? messageBroker.storageDisplayName(brokerQueueDetail)
176+
: queueConfig.getQueueName();
177+
String runningDisplayName =
178+
brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
179+
? messageBroker.storageDisplayName(brokerQueueDetail)
180+
: processingQueueName;
179181
List<Entry<NavTab, RedisDataDetail>> queueRedisDataDetails = newArrayList(
180182
new HashMap.SimpleEntry<>(
181183
NavTab.PENDING,
182-
new RedisDataDetail(
183-
pendingDisplayName, DataType.LIST, pending == null ? 0 : pending)),
184+
new RedisDataDetail(pendingDisplayName, DataType.LIST, pending == null ? 0 : pending)),
184185
new HashMap.SimpleEntry<>(
185186
NavTab.RUNNING,
186-
new RedisDataDetail(
187-
runningDisplayName, DataType.ZSET, running == null ? 0 : running)));
187+
new RedisDataDetail(runningDisplayName, DataType.ZSET, running == null ? 0 : running)));
188188
String scheduledQueueName = queueConfig.getScheduledQueueName();
189189
// When the broker doesn't support scheduled introspection (e.g. JetStream), suppress
190190
// the SCHEDULED nav tab entry entirely so the dashboard doesn't query an absent ZSET.
@@ -197,7 +197,8 @@ public List<Entry<NavTab, RedisDataDetail>> getQueueDataStructureDetail(QueueCon
197197
}
198198
if (!CollectionUtils.isEmpty(queueConfig.getDeadLetterQueues())) {
199199
for (DeadLetterQueue dlq : queueConfig.getDeadLetterQueues()) {
200-
String dlqDisplayName = brokerQueueDetail != null && messageBroker.dlqStorageDisplayName(brokerQueueDetail) != null
200+
String dlqDisplayName = brokerQueueDetail != null
201+
&& messageBroker.dlqStorageDisplayName(brokerQueueDetail) != null
201202
? messageBroker.dlqStorageDisplayName(brokerQueueDetail)
202203
: dlq.getName();
203204
if (!dlq.isConsumerEnabled()) {
@@ -216,15 +217,14 @@ public List<Entry<NavTab, RedisDataDetail>> getQueueDataStructureDetail(QueueCon
216217
&& !StringUtils.isEmpty(queueConfig.getCompletedQueueName())) {
217218
Long completed =
218219
messageBrowsingRepository.getDataSize(queueConfig.getCompletedQueueName(), DataType.ZSET);
219-
String completedDisplayName = brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
220-
? messageBroker.storageDisplayName(brokerQueueDetail)
221-
: queueConfig.getCompletedQueueName();
220+
String completedDisplayName =
221+
brokerQueueDetail != null && messageBroker.storageDisplayName(brokerQueueDetail) != null
222+
? messageBroker.storageDisplayName(brokerQueueDetail)
223+
: queueConfig.getCompletedQueueName();
222224
queueRedisDataDetails.add(new HashMap.SimpleEntry<>(
223225
NavTab.COMPLETED,
224226
new RedisDataDetail(
225-
completedDisplayName,
226-
DataType.ZSET,
227-
completed == null ? 0 : completed)));
227+
completedDisplayName, DataType.ZSET, completed == null ? 0 : completed)));
228228
}
229229
return queueRedisDataDetails;
230230
}

0 commit comments

Comments
 (0)