feat: Introduced a kafka-like `ShardingStrategy` for `inmemory`
- Introduced the `ShardingStrategy`, that picks a shard for a given
`ChatRoom`-ID.
- Implemented a `KafkaLikeShardingStrategy`, that reuses the hashing
algorithm, that is implementd in `Utils.murmur2()` in the
`org.apache.kafka:kafka-clients` library.
- The attribute `shard` of the `ChatHome` has to be restored according
to the configured `ShardingStrategy` when loading the state - it must
not be safed with the stored data, because it might change due to
configuration-changes.
- The `ChatBackendController` was not configured correctly, because it
had consumed the single `ChatHome` from the old configuration as the
only entry in its `ChatHome[]`-array.
- Refined the application-properties: Introduced an inner subclass
`InMemoryServicesProperties` of `ChatBackendProperties`, that
encapsulates the properties, that only concern the implementation
`inmemory`.
- Added the configuration-parameters `numShards` and `ownedShards`,
that are needed by `inmemory`, to handle the sharding correctly.
- Introduced `ChatHomeFactory`, because the `ChatHome`s are instanciated
by `ChatBackendConfiguration`, which is not aware of the configured
implementation.
- Adjusted the test-cases to the changes.
- Added `InMemoryWithFilesAndShardingConfigurationIT`, that asserts,
that the application works as expected, if sharding is activated.
24 files changed: