Skip to content

Commit

Permalink
fixed that for empty BulkUpdate no "BulkWriteComplete" was sent back …
Browse files Browse the repository at this point in the history
…to ThingUpdaters

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Mar 9, 2022
1 parent 6ebbe7e commit 5a9f314
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,18 @@ private Source<WriteResultAndErrors, NotUsed> executeBulkWrite(final boolean sho
final var abstractWriteModels = pairs.stream().map(Pair::first).toList();
final var writeModels = pairs.stream().map(Pair::second).toList();

final String bulkWriteCorrelationId = UUID.randomUUID().toString();
if (writeModels.isEmpty()) {
LOGGER.debug("Requested to make empty update by write models <{}>", abstractWriteModels);
LOGGER.withCorrelationId(bulkWriteCorrelationId)
.debug("Requested to make empty update by write models <{}>", abstractWriteModels);
for (final var abstractWriteModel : abstractWriteModels) {
abstractWriteModel.getMetadata().sendWeakAck(null);
abstractWriteModel.getMetadata().getOrigin().ifPresent(origin ->
origin.tell(BulkWriteComplete.of(bulkWriteCorrelationId), ActorRef.noSender()));
}
return Source.empty();
}

final String bulkWriteCorrelationId = UUID.randomUUID().toString();
if (LOGGER.isDebugEnabled()) {
LOGGER.withCorrelationId(bulkWriteCorrelationId)
.debug("Executing BulkWrite containing [<thingId>:{correlationIds}:<filter>]: {}", pairs.stream()
Expand Down

0 comments on commit 5a9f314

Please sign in to comment.