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 @@ -260,7 +260,7 @@ public Registration registerCommandHandler(Function<Command, CompletableFuture<C
CompletableFuture<Void> ack = sendSubscribe(commandName, loadFactor, outboundCommandStream.get());
subscriptionResult = CompletableFuture.allOf(subscriptionResult, ack).whenComplete((r,e) -> {
if (e == null) {
logger.info("Registered handler for command '{}' in context '{}'", commandName, context);
logger.debug("Registered handler for command '{}' in context '{}'", commandName, context);
} else {
logger.warn("An error occurred while registering command '{}' in context '{}'", commandName, context, e);
}
Expand Down Expand Up @@ -290,7 +290,7 @@ private CompletableFuture<Void> unsubscribe(CommandHandler handler,
CompletableFuture<Void> future = CompletableFuture.completedFuture(null);
for (String commandName : commandNames) {
if (commandHandlers.get(commandName) == handler) {
logger.info("Deregistered handler for command '{}' in context '{}'", commandName, context);
logger.debug("Deregistered handler for command '{}' in context '{}'", commandName, context);
CompletableFuture<Void> result = sendUnsubscribe(commandName, outboundCommandStream.get())
.thenRun(() -> commandHandlers.remove(commandName, handler));
future = CompletableFuture.allOf(future, result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
}

@Override
public Registration registerQueryHandler(QueryHandler handler, QueryDefinition... queryDefinitions) {

Check failure on line 301 in src/main/java/io/axoniq/axonserver/connector/query/impl/QueryChannelImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this method to reduce its Cognitive Complexity from 19 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=AxonIQ_axonserver-connector-java&issues=AaAynhgcUxYtCJlgBvcx&open=AaAynhgcUxYtCJlgBvcx&pullRequest=460
CompletableFuture<Void> subscriptionResult = CompletableFuture.completedFuture(null);
synchronized (queryHandlerMonitor) {
if (queryHandlers.isEmpty()) {
Expand All @@ -319,7 +319,7 @@
outboundQueryStream.get());
subscriptionResult = CompletableFuture.allOf(subscriptionResult, instructionResult).whenComplete((r,e) -> {
if (e == null) {
logger.info("Registered handler for query '{}' in context '{}'", queryDefinition.getQueryName(), context);
logger.debug("Registered handler for query '{}' in context '{}'", queryDefinition.getQueryName(), context);
} else {
logger.warn("An error occurred while registering query '{}' in context '{}'", queryDefinition.getQueryName(), context, e);
}
Expand Down
Loading