Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Sharding.Delivery bypass feature #7106

Conversation

Arkatufus
Copy link
Contributor

Fixes #7089

Changes

Implements a bypass mechanism for Akka.Cluster.Sharding.Delivery needed for custom sharding handoff stop to work under sharding delivery.
To turn this feature on, set "akka.reliable-delivery.sharding.consumer-controller.allow-bypass" to true.

Copy link
Contributor Author

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-review

}
else
{
_log.Warning($"Message unhandled [{msg}]. If you need to pass this message to the consumer sharding entity actor, set \"akka.reliable-delivery.sharding.consumer-controller.allow-bypass\" to true");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log a warning when a message was unhandled, informing the user that they can allow this message to be forwarded if they set allow-bypass to true

Comment on lines +289 to +292
# Allow arbitrary message to be directly sent to the customer actor,
# this lets you use custom handoff messages to be used along side with
# cluster sharding reliable delivery
allow-bypass = false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New HOCON settings

settings: Settings.Value.WithRole(null),
messageExtractor: new MessageExtractor(),
allocationStrategy: ShardAllocationStrategy.LeastShardAllocationStrategy(absoluteLimit: 2, relativeLimit: 1.0),
handOffStopMessage: SlowStopConsumerEntity.Stop.Instance);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would not work without the new allow-bypass feature

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Changed `.Tell` to `.Forward`
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - fixed my own suggestions

settings: Settings.Value.WithRole(null),
messageExtractor: new MessageExtractor(),
allocationStrategy: ShardAllocationStrategy.LeastShardAllocationStrategy(absoluteLimit: 2, relativeLimit: 1.0),
handOffStopMessage: SlowStopConsumerEntity.Stop.Instance);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb Aaronontheweb enabled auto-merge (squash) February 29, 2024 17:06
@Aaronontheweb Aaronontheweb merged commit 62edf08 into akkadotnet:dev Feb 29, 2024
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants