Skip to content

Commit

Permalink
Minor code changes during review
Browse files Browse the repository at this point in the history
Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Aug 18, 2021
1 parent 4c33e20 commit f117458
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ private void invalidateCaches(final CacheKey entityId) {
@Override
protected Contextual<WithDittoHeaders> beforeProcessMessage(final Contextual<WithDittoHeaders> contextual) {
final StartedTimer startedTimer = createTimer(contextual.getMessage());
final Context context =
DittoTracing.wrapTimer(DittoTracing.extractTraceContext(contextual.getMessage()), startedTimer);
final Context traceContext = DittoTracing.extractTraceContext(contextual.getMessage());
final Context context = DittoTracing.wrapTimer(traceContext, startedTimer);
final Contextual<WithDittoHeaders> withTimer = contextual.withTimer(startedTimer);
if (contextual.getMessage() instanceof DittoHeadersSettable) {
final DittoHeadersSettable<?> message = ((DittoHeadersSettable<?>) contextual.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import akka.pattern.Patterns;
import akka.stream.javadsl.Flow;
import akka.stream.javadsl.Sink;
import kamon.context.Context;

/**
* Base class for consumer actors that holds common fields and handles the address status.
Expand Down Expand Up @@ -130,8 +131,8 @@ private void prepareResponseHandler(final AcknowledgeableMessage acknowledgeable
.tag(TracingTags.CONNECTION_ID, connectionId.toString())
.tag(TracingTags.CONNECTION_TYPE, connectionType.getName())
.start();
DittoTracing.wrapTimer(DittoTracing.extractTraceContext(acknowledgeableMessage.getMessage().getHeaders()),
timer);
final Context traceContext = DittoTracing.extractTraceContext(acknowledgeableMessage.getMessage().getHeaders());
DittoTracing.wrapTimer(traceContext, timer);

final Duration askTimeout = acknowledgementConfig.getCollectorFallbackAskTimeout();
// Ask response collector actor to get the collected responses in a future
Expand Down Expand Up @@ -207,7 +208,7 @@ private void prepareResponseHandler(final AcknowledgeableMessage acknowledgeable
*/
protected final Sink<DittoRuntimeException, ?> getDittoRuntimeExceptionSink() {
return Flow.<DittoRuntimeException, DittoRuntimeException>fromFunction(
message -> message.setDittoHeaders(enrichHeadersWithReplyInformation(message.getDittoHeaders())))
message -> message.setDittoHeaders(enrichHeadersWithReplyInformation(message.getDittoHeaders())))
.via(Flow.<DittoRuntimeException, Object>fromFunction(value -> {
inboundMonitor.failure(value.getDittoHeaders(), value);
return value;
Expand Down

0 comments on commit f117458

Please sign in to comment.