Use Mono.share() for mrmMessageMono

This commit is contained in:
Chris Eager 2024-09-26 10:39:45 -05:00 committed by Chris Eager
parent 513f19370a
commit ab2e6bb9a3
2 changed files with 4 additions and 3 deletions

View File

@ -444,7 +444,7 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
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;
@ -461,7 +461,8 @@ public class MessagesCache extends RedisClusterPubSubAdapter<String, String> imp
} catch (Exception e) {
sink.error(e);
}
});
})
.share();
experiment.compareMonoResult(mrmMessage.toBuilder().clearSharedMrmKey().build(), mrmMessageMono);

View File

@ -575,7 +575,7 @@ class MessagesCacheTest {
if (sharedMrmKeyPresent) {
sharedMrmDataKey = messagesCache.insertSharedMultiRecipientMessagePayload(mrm);
} else {
sharedMrmDataKey = new byte[]{1};
sharedMrmDataKey = "{1}".getBytes(StandardCharsets.UTF_8);
}
final UUID guid = UUID.randomUUID();