Skip to content

Commit

Permalink
add debug log for dropped signals, if target address can not be resol…
Browse files Browse the repository at this point in the history
…ved;

Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed May 26, 2021
1 parent c888bf1 commit cab53d0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,12 @@ private SendingOrDropped publishToGenericTarget(final ExpressionResolver resolve
final GenericTarget genericTarget = sendingContext.getGenericTarget();
final String address = genericTarget.getAddress();
final Optional<T> publishTargetOptional = resolveTargetAddress(resolver, address).map(this::toPublishTarget);
final Signal<?> outboundSource = outbound.getSource();
final ThreadSafeDittoLoggingAdapter l = logger.withCorrelationId(outboundSource);

final SendingOrDropped result;
if (publishTargetOptional.isPresent()) {
final T publishTarget = publishTargetOptional.get();
final Signal<?> outboundSource = outbound.getSource();
final ThreadSafeDittoLoggingAdapter l = logger.withCorrelationId(outboundSource);
l.info("Publishing mapped message of type <{}> to PublishTarget <{}>", outboundSource.getType(),
publishTarget);
l.debug("Publishing mapped message of type <{}> to PublishTarget <{}>: {}", outboundSource.getType(),
Expand All @@ -427,6 +427,7 @@ private SendingOrDropped publishToGenericTarget(final ExpressionResolver resolve
result = new Sending(sendingContext.setExternalMessage(mappedMessage), responsesFuture,
connectionIdResolver, l);
} else {
l.debug("Signal dropped, target address unresolved: {0}", address);
result = new Dropped(sendingContext, "Signal dropped, target address unresolved: {0}");
}
return result;
Expand Down

0 comments on commit cab53d0

Please sign in to comment.