Skip to content

Commit

Permalink
Apply header validation after additional inbound headers are added
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 30, 2022
1 parent 2fb85ce commit 88a9e52
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -159,12 +159,11 @@ private Stream<MappingOutcome<MappedInboundExternalMessage>> runMapper(final Mes
try {
final Signal<?> signal =
timer.inboundProtocol(() -> protocolAdapter.fromAdaptable(adaptable));
final DittoHeaders dittoHeaders = signal.getDittoHeaders();
dittoHeadersSizeValidator.validate(dittoHeaders).toCompletableFuture().join();
final DittoHeaders headersWithMapper = dittoHeaders.toBuilder()
final DittoHeaders headersWithMapper = signal.getDittoHeaders().toBuilder()
.inboundPayloadMapper(mapper.getId())
.putHeaders(additionalInboundHeaders)
.build();
dittoHeadersSizeValidator.validate(headersWithMapper).toCompletableFuture().join();
final Signal<?> signalWithMapperHeader = signal.setDittoHeaders(headersWithMapper);
final MappedInboundExternalMessage mappedMessage =
MappedInboundExternalMessage.of(message, adaptable.getTopicPath(),
Expand Down

0 comments on commit 88a9e52

Please sign in to comment.