diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index aff5231a..eb39246e 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,2 +1,2 @@
-## [0.1.1] / 18 March 2022
-- Upgraded to [Akka.NET v1.4.35](https://github.com/akkadotnet/akka.net/releases/tag/1.4.35)
+## [0.1.2] / 31 March 2022
+- Removed all `Cluster.Sharding` methods that rely on `ClusterShardingSettings`, since it's not practical to create those prior to starting the `ActorSystem`.
diff --git a/src/Akka.Cluster.Hosting/AkkaClusterHostingExtensions.cs b/src/Akka.Cluster.Hosting/AkkaClusterHostingExtensions.cs
index e5ff00f8..d0473d7d 100644
--- a/src/Akka.Cluster.Hosting/AkkaClusterHostingExtensions.cs
+++ b/src/Akka.Cluster.Hosting/AkkaClusterHostingExtensions.cs
@@ -97,85 +97,6 @@ public static AkkaConfigurationBuilder WithClustering(this AkkaConfigurationBuil
return hoconBuilder.WithActorRefProvider(ProviderSelection.Cluster.Instance);
}
- ///
- /// Starts a actor for the given entity
- /// and registers the ShardRegion with in the
- /// for this .
- ///
- /// The builder instance being configured.
- /// The name of the entity type
- ///
- /// Function that, given an entity id, returns the of the entity actors that will be created by the
- ///
- /// Configuration settings, see
- ///
- /// Functions to extract the entity id, shard id, and the message to send to the entity from the incoming message.
- ///
- /// Possibility to use a custom shard allocation and rebalancing logic
- ///
- /// The message that will be sent to entities when they are to be stopped for a rebalance or
- /// graceful shutdown of a , e.g. .
- ///
- /// The type key to use to retrieve the for this .
- /// The same instance originally passed in.
- public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurationBuilder builder,
- string typeName,
- Func entityPropsFactory, IMessageExtractor messageExtractor,
- ClusterShardingSettings settings,
- IShardAllocationStrategy allocationStrategy,
- object handOffStopMessage)
- {
- return builder.WithActors(async (system, registry) =>
- {
- var shardRegion = await ClusterSharding.Get(system).StartAsync(typeName, entityPropsFactory, settings,
- messageExtractor,
- allocationStrategy, handOffStopMessage);
- registry.TryRegister(shardRegion);
- });
- }
-
- ///
- /// Starts a actor for the given entity
- /// and registers the ShardRegion with in the
- /// for this .
- ///
- /// The builder instance being configured.
- /// The name of the entity type
- ///
- /// Function that, given an entity id, returns the of the entity actors that will be created by the
- ///
- /// Configuration settings, see
- ///
- /// Partial function to extract the entity id and the message to send to the entity from the incoming message,
- /// if the partial function does not match the message will be `unhandled`,
- /// i.e.posted as `Unhandled` messages on the event stream
- ///
- ///
- /// Function to determine the shard id for an incoming message, only messages that passed the `extractEntityId` will be used
- ///
- /// Possibility to use a custom shard allocation and rebalancing logic
- ///
- /// The message that will be sent to entities when they are to be stopped for a rebalance or
- /// graceful shutdown of a , e.g. .
- ///
- /// The type key to use to retrieve the for this .
- /// The same instance originally passed in.
- public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurationBuilder builder,
- string typeName,
- Func entityPropsFactory, ExtractEntityId extractEntityId, ExtractShardId extractShardId,
- ClusterShardingSettings settings,
- IShardAllocationStrategy allocationStrategy,
- object handOffStopMessage)
- {
- return builder.WithActors(async (system, registry) =>
- {
- var shardRegion = await ClusterSharding.Get(system)
- .StartAsync(typeName, entityPropsFactory, settings, extractEntityId, extractShardId,
- allocationStrategy, handOffStopMessage);
- registry.TryRegister(shardRegion);
- });
- }
-
///
/// Starts a actor for the given entity
/// and registers the ShardRegion with in the
@@ -217,36 +138,6 @@ public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurat
///
/// Function that, given an entity id, returns the of the entity actors that will be created by the
///
- /// Configuration settings, see
- ///
- /// Functions to extract the entity id, shard id, and the message to send to the entity from the incoming message.
- ///
- /// The type key to use to retrieve the for this .
- /// The same instance originally passed in.
- public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurationBuilder builder,
- string typeName,
- Func entityPropsFactory, IMessageExtractor messageExtractor,
- ClusterShardingSettings settings)
- {
- return builder.WithActors(async (system, registry) =>
- {
- var shardRegion = await ClusterSharding.Get(system).StartAsync(typeName, entityPropsFactory,
- settings, messageExtractor);
- registry.TryRegister(shardRegion);
- });
- }
-
- ///
- /// Starts a actor for the given entity
- /// and registers the ShardRegion with in the
- /// for this .
- ///
- /// The builder instance being configured.
- /// The name of the entity type
- ///
- /// Function that, given an entity id, returns the of the entity actors that will be created by the
- ///
- /// Configuration settings, see
///
/// Partial function to extract the entity id and the message to send to the entity from the incoming message,
/// if the partial function does not match the message will be `unhandled`,
@@ -255,17 +146,21 @@ public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurat
///
/// Function to determine the shard id for an incoming message, only messages that passed the `extractEntityId` will be used
///
+ /// The set of options for configuring
/// The type key to use to retrieve the for this .
/// The same instance originally passed in.
public static AkkaConfigurationBuilder WithShardRegion(this AkkaConfigurationBuilder builder,
string typeName,
Func entityPropsFactory, ExtractEntityId extractEntityId, ExtractShardId extractShardId,
- ClusterShardingSettings settings)
+ ShardOptions shardOptions)
{
return builder.WithActors(async (system, registry) =>
{
var shardRegion = await ClusterSharding.Get(system).StartAsync(typeName, entityPropsFactory,
- settings, extractEntityId, extractShardId);
+ ClusterShardingSettings.Create(system)
+ .WithRole(shardOptions.Role)
+ .WithRememberEntities(shardOptions.RememberEntities)
+ .WithStateStoreMode(shardOptions.StateStoreMode), extractEntityId, extractShardId);
registry.TryRegister(shardRegion);
});
}
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index d12dfa1d..bb408a45 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -2,8 +2,8 @@
Copyright © 2013-2022 Akka.NET Team
Akka.NET Team
- 0.1.0
- • Initial release of Akka.Hosting%2C Akka.Remote.Hosting%2C Akka.Cluster.Hosting%2C and Akka.Persistence.SqlServer.Hosting
+ 0.1.2
+ • Removed all Cluster.Sharding methods that rely on ClusterShardingSettings%2C since it's not practical to create those prior to starting the ActorSystem.