Fixing Akkling (F#) cluster sharding support broken after Akka.NET 1.5.15 release #7058
-
Akka.NET 1.5.15 comes with an updated IMessageExtractor interface optimized to give better performance for computing ShardId. Akkling open source library has an internal type TypedMessageExtractor that needs to be updated for the revised IMessageExtractor interface. Here' the previous version of TypedMessageExtractor:
TypedMessageExtractor constructor takes a parameter extractor which is a function that for a given instance of Envelope returns a tuple of EntityId, ShardId and Message. This no longer fits the new IMessageExtractor interface which has an overload computing ShardId from EntityId. But the overload has an extra parameter messageHint and I supposed it can be used as a fallback. Here's a proposed workaround to make TypedMessageExtractor compatible with the new IMessageExtractor. New method:
As you see, the entityId parameter is not used in the implementation, instead extractor function is applied to a messageHint parameter. I tested it in our project, and it seems to work. Is this a sufficient workaround to have a maintenance release of Akkling library that will work with Akka.NET 1.5.15? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The So yes @object I think that work-around should work in lieu of a maintenance update for Akkling. Does that help answer your question? |
Beta Was this translation helpful? Give feedback.
The
messageHint
variable was designed for exactly this type of scenario - to add backwards compat for cases where theShardId
needs to be computed from the message (i.e. working with theExtractShardId
delegate in Akka.NET, which has this limitation.)So yes @object I think that work-around should work in lieu of a maintenance update for Akkling. Does that help answer your question?