Skip to content

Logging of Query- and CommandChannel is misleading when Server is unavailable #461

@jangalinski

Description

@jangalinski

Enhancement Description

When starting an app with axon server not running/not available (see axonframwork#3938 we noticed some misleading info level log statements for connecting 0 handlers.

Current Behaviour

example: CommandChannelImpl:

logger.info("Registered handler for command '{}' in context '{}'", commandName, context);
            CompletableFuture<Void> ack = sendSubscribe(commandName, loadFactor, outboundCommandStream.get());
            subscriptionResult = CompletableFuture.allOf(subscriptionResult, ack);

Registered Handler is logged without usind the subscriptionResult.

Wanted Behaviour

subscriptionResult = CompletableFuture.allOf(subscriptionResult, ack).whenComplete((r,e) -> {
                if (e == null) {
                    logger.info("Registered handler for command '{}' in context '{}'", commandName, context);
                } else {
                    logger.warn("An error occurred while registering command '{}' in context '{}'", commandName, context, e);
                }
            } );

success/error are logged on different levels depending on the outcome of the subscriptionResult.

Possible Workarounds

  • live with misleading log statements

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions