Skip to content

Commit

Permalink
Bump AkkaVersion from 1.5.14 to 1.5.15 (#426)
Browse files Browse the repository at this point in the history
* Bump AkkaVersion from 1.5.14 to 1.5.15

Bumps `AkkaVersion` from 1.5.14 to 1.5.15.

Updates `Akka.DependencyInjection` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

Updates `Akka.TestKit.Xunit2` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

Updates `Akka.Cluster.Sharding` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

Updates `Akka.Remote` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

Updates `Akka.DistributedData` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

Updates `Akka.Persistence` from 1.5.14 to 1.5.15
- [Release notes](https://github.com/akkadotnet/akka.net/releases)
- [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md)
- [Commits](akkadotnet/akka.net@1.5.14...1.5.15)

---
updated-dependencies:
- dependency-name: Akka.DependencyInjection
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Akka.TestKit.Xunit2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Akka.Cluster.Sharding
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Akka.Remote
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Akka.DistributedData
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: Akka.Persistence
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* standardized Akka.Hosting NuGet package version range to `[6.0,*)`

* fixed build warnings

* API approvals

* fixing issues with xUnit call updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aaron Stannard <aaron@petabridge.com>
  • Loading branch information
dependabot[bot] and Aaronontheweb authored Jan 10, 2024
1 parent a057335 commit fe9a2b0
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/Akka.Cluster.Hosting.Tests/XUnitLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public XUnitLogger(string category, ITestOutputHelper helper, LogLevel logLevel)
_logLevel = logLevel;
}

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception?, string> formatter)
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if (!IsEnabled(logLevel))
return;
Expand Down Expand Up @@ -65,8 +65,8 @@ public IDisposable BeginScope<TState>(TState state)

private static bool TryFormatMessage<TState>(
TState state,
Exception exception,
Func<TState, Exception, string> formatter,
Exception? exception,
Func<TState, Exception?, string> formatter,
out string? result)
{
formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));
Expand Down
4 changes: 4 additions & 0 deletions src/Akka.Cluster.Hosting/AkkaClusterHostingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ public static AkkaConfigurationBuilder WithShardRegion<TKey>(
/// <returns>
/// The same <see cref="AkkaConfigurationBuilder"/> instance originally passed in.
/// </returns>
[Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates.")]
public static AkkaConfigurationBuilder WithShardRegion<TKey>(
this AkkaConfigurationBuilder builder,
string typeName,
Expand Down Expand Up @@ -799,6 +800,7 @@ public static AkkaConfigurationBuilder WithShardRegion<TKey>(
/// <returns>
/// The same <see cref="AkkaConfigurationBuilder"/> instance originally passed in.
/// </returns>
[Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates.")]
public static AkkaConfigurationBuilder WithShardRegion<TKey>(
this AkkaConfigurationBuilder builder,
string typeName,
Expand Down Expand Up @@ -899,6 +901,7 @@ async Task Resolver(ActorSystem system, IActorRegistry registry, IDependencyReso
/// <returns>
/// The same <see cref="AkkaConfigurationBuilder"/> instance originally passed in.
/// </returns>
[Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates.")]
public static AkkaConfigurationBuilder WithShardRegion<TKey>(
this AkkaConfigurationBuilder builder,
string typeName,
Expand Down Expand Up @@ -954,6 +957,7 @@ async Task Resolver(ActorSystem system, IActorRegistry registry, IDependencyReso
/// <returns>
/// The same <see cref="AkkaConfigurationBuilder"/> instance originally passed in.
/// </returns>
[Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates.")]
public static AkkaConfigurationBuilder WithShardRegionProxy<TKey>(
this AkkaConfigurationBuilder builder,
string typeName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ namespace Akka.Cluster.Hosting
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<string, Akka.Actor.Props> entityPropsFactory, Akka.Cluster.Sharding.IMessageExtractor messageExtractor, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<Akka.Actor.ActorSystem, Akka.Hosting.IActorRegistry, System.Func<string, Akka.Actor.Props>> entityPropsFactory, Akka.Cluster.Sharding.IMessageExtractor messageExtractor, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<Akka.Actor.ActorSystem, Akka.Hosting.IActorRegistry, Akka.DependencyInjection.IDependencyResolver, System.Func<string, Akka.Actor.Props>> entityPropsFactory, Akka.Cluster.Sharding.IMessageExtractor messageExtractor, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
[System.Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates" +
".")]
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<string, Akka.Actor.Props> entityPropsFactory, Akka.Cluster.Sharding.ExtractEntityId extractEntityId, Akka.Cluster.Sharding.ExtractShardId extractShardId, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
[System.Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates" +
".")]
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<Akka.Actor.ActorSystem, Akka.Hosting.IActorRegistry, System.Func<string, Akka.Actor.Props>> entityPropsFactory, Akka.Cluster.Sharding.ExtractEntityId extractEntityId, Akka.Cluster.Sharding.ExtractShardId extractShardId, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
[System.Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates" +
".")]
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegion<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, System.Func<Akka.Actor.ActorSystem, Akka.Hosting.IActorRegistry, Akka.DependencyInjection.IDependencyResolver, System.Func<string, Akka.Actor.Props>> entityPropsFactory, Akka.Cluster.Sharding.ExtractEntityId extractEntityId, Akka.Cluster.Sharding.ExtractShardId extractShardId, Akka.Cluster.Hosting.ShardOptions shardOptions) { }
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegionProxy<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, string roleName, Akka.Cluster.Sharding.IMessageExtractor messageExtractor) { }
[System.Obsolete("Use IMessageExtractor instead of the ExtractEntityId and ExtractShardId delegates" +
".")]
public static Akka.Hosting.AkkaConfigurationBuilder WithShardRegionProxy<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string typeName, string roleName, Akka.Cluster.Sharding.ExtractEntityId extractEntityId, Akka.Cluster.Sharding.ExtractShardId extractShardId) { }
public static Akka.Hosting.AkkaConfigurationBuilder WithSingleton<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string singletonName, Akka.Actor.Props actorProps, Akka.Cluster.Hosting.ClusterSingletonOptions? options = null, bool createProxyToo = true) { }
public static Akka.Hosting.AkkaConfigurationBuilder WithSingleton<TKey>(this Akka.Hosting.AkkaConfigurationBuilder builder, string singletonName, System.Func<Akka.Actor.ActorSystem, Akka.Hosting.IActorRegistry, Akka.DependencyInjection.IDependencyResolver, Akka.Actor.Props> propsFactory, Akka.Cluster.Hosting.ClusterSingletonOptions? options = null, bool createProxyToo = true) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public void Should_timeout_if_too_few_messages()
{
LogMessage("whatever");
});
}).Should().Throw<TrueException>().WithMessage("timeout*");
}).Should().Throw<FailException>().WithMessage("timeout*");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void ShouldFailIfMoreExceptionsThenSpecifiedAreLogged()
Log.Error(new SomeException(), "whatever");
Log.Error(new SomeException(), "whatever");
}))
.Should().Throw<TrueException>().WithMessage("*1 message too many*");
.Should().Throw<FailException>().WithMessage("*1 message too many*");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void AwaitCondition_should_dilate_timeout()
{
var stopwatch = Stopwatch.StartNew();
Invoking(() => AwaitCondition(() => false, TimeSpan.FromMilliseconds(Timeout)))
.Should().Throw<TrueException>();
.Should().Throw<FailException>();
stopwatch.Stop();
AssertDilated(stopwatch.ElapsedMilliseconds, $"Expected the timeout to be {ExpectedTimeout} but in fact it was {stopwatch.ElapsedMilliseconds}.");
}
Expand Down
6 changes: 3 additions & 3 deletions src/Akka.Hosting.Tests/XUnitLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public XUnitLogger(string category, ITestOutputHelper helper, LogLevel logLevel)
_logLevel = logLevel;
}

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception?, string> formatter)
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
{
if (!IsEnabled(logLevel))
return;
Expand Down Expand Up @@ -65,8 +65,8 @@ public IDisposable BeginScope<TState>(TState state)

private static bool TryFormatMessage<TState>(
TState state,
Exception exception,
Func<TState, Exception, string> formatter,
Exception? exception,
Func<TState, Exception?, string> formatter,
out string? result)
{
formatter = formatter ?? throw new ArgumentNullException(nameof(formatter));
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<TestSdkVersion>17.8.0</TestSdkVersion>
<CoverletVersion>6.0.0</CoverletVersion>
<XunitRunneVisualstudio>2.5.6</XunitRunneVisualstudio>
<AkkaVersion>1.5.14</AkkaVersion>
<MicrosoftExtensionsVersion>[3.0.0,)</MicrosoftExtensionsVersion>
<AkkaVersion>1.5.15</AkkaVersion>
<MicrosoftExtensionsVersion>[6.0.0,)</MicrosoftExtensionsVersion>
</PropertyGroup>

<!-- SourceLink support for all Akka.NET projects -->
Expand Down
21 changes: 8 additions & 13 deletions src/Examples/Akka.Hosting.SimpleDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Akka.Actor;
using Akka.Cluster.Hosting;
using Akka.Cluster.Sharding;
using Akka.Remote.Hosting;
using Akka.Util;

Expand Down Expand Up @@ -35,18 +36,13 @@ public EchoActor(string entityId, IReplyGenerator replyGenerator)
public class Program
{
private const int NumberOfShards = 5;

private static Option<(string, object)> ExtractEntityId(object message)
=> message switch {
string id => (id, id),
_ => Option<(string, object)>.None
};

private static string? ExtractShardId(object message)
=> message switch {
string id => (id.GetHashCode() % NumberOfShards).ToString(),
_ => null
};
private static IMessageExtractor Extractor { get; } = HashCodeMessageExtractor.Create(NumberOfShards, msg =>
{
if (msg is string id)
return id;
return string.Empty;
});

public static void Main(params string[] args)
{
Expand All @@ -64,8 +60,7 @@ public static void Main(params string[] args)
{
return s => resolver.Props<EchoActor>(s);
},
extractEntityId: ExtractEntityId,
extractShardId: ExtractShardId,
messageExtractor: Extractor,
shardOptions: new ShardOptions());
});

Expand Down

0 comments on commit fe9a2b0

Please sign in to comment.