Introduce MessageStream and RedisDynamoDbMessagePublisher

This commit is contained in:
Jon Chambers
2025-08-08 09:27:05 -04:00
committed by GitHub
parent 6d71f43b6c
commit d96c360016
17 changed files with 972 additions and 22 deletions

View File

@@ -29,5 +29,5 @@ public interface MessageAvailabilityListener {
* Indicates a newer instance of this client has started reading messages and the listener should close this client's
* underlying network connection.
*/
void handleConflictingMessageReader();
void handleConflictingMessageConsumer();
}

View File

@@ -132,7 +132,7 @@ public class RedisMessageAvailabilityManager extends RedisClusterPubSubAdapter<b
/**
* Marks the given device as "present" for message delivery and registers a listener for new messages and conflicting
* connections. If the given device already has a presence registered with this manager, that presence is displaced
* immediately and the listener's {@link MessageAvailabilityListener#handleConflictingMessageReader()} method is called.
* immediately and the listener's {@link MessageAvailabilityListener#handleConflictingMessageConsumer()} method is called.
*
* @param accountIdentifier the account identifier for the newly-connected device
* @param deviceId the ID of the newly-connected device within the given account
@@ -176,7 +176,7 @@ public class RedisMessageAvailabilityManager extends RedisClusterPubSubAdapter<b
});
if (displacedListener.get() != null) {
listenerEventExecutor.execute(() -> displacedListener.get().handleConflictingMessageReader());
listenerEventExecutor.execute(() -> displacedListener.get().handleConflictingMessageConsumer());
}
return subscribeFuture.get()
@@ -318,7 +318,7 @@ public class RedisMessageAvailabilityManager extends RedisClusterPubSubAdapter<b
// Only act on new connections to other event manager instances; we'll learn about displacements in THIS
// instance when we update the listener map in `handleClientConnected`
if (!this.serverId.equals(UUIDUtil.fromByteString(clientEvent.getClientConnected().getServerId()))) {
listenerEventExecutor.execute(listener::handleConflictingMessageReader);
listenerEventExecutor.execute(listener::handleConflictingMessageConsumer);
}
}