Skip to content

Commit

Permalink
Use Mono.share() for mrmMessageMono
Browse files Browse the repository at this point in the history
  • Loading branch information
eager-signal committed Sep 26, 2024
1 parent 513f193 commit ab2e6bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ private Mono<?> maybeRunMrmViewExperiment(final MessageProtos.Envelope mrmMessag
conn -> conn.reactive().hmget(key, "data".getBytes(StandardCharsets.UTF_8), sharedMrmViewKey)
.collectList()
.publishOn(messageDeliveryScheduler)))
.handle((mrmDataAndView, sink) -> {
.<MessageProtos.Envelope>handle((mrmDataAndView, sink) -> {
try {
assert mrmDataAndView.size() == 2;

Expand All @@ -461,7 +461,8 @@ private Mono<?> maybeRunMrmViewExperiment(final MessageProtos.Envelope mrmMessag
} catch (Exception e) {
sink.error(e);
}
});
})
.share();

experiment.compareMonoResult(mrmMessage.toBuilder().clearSharedMrmKey().build(), mrmMessageMono);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void testMultiRecipientMessage(final boolean sharedMrmKeyPresent) throws Excepti
if (sharedMrmKeyPresent) {
sharedMrmDataKey = messagesCache.insertSharedMultiRecipientMessagePayload(mrm);
} else {
sharedMrmDataKey = new byte[]{1};
sharedMrmDataKey = "{1}".getBytes(StandardCharsets.UTF_8);
}

final UUID guid = UUID.randomUUID();
Expand Down

0 comments on commit ab2e6bb

Please sign in to comment.