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

Some clarifications on duplicate messages #12

Open
antogh opened this issue Feb 11, 2016 · 0 comments
Open

Some clarifications on duplicate messages #12

antogh opened this issue Feb 11, 2016 · 0 comments

Comments

@antogh
Copy link
Contributor

antogh commented Feb 11, 2016

Hello,
I was trying to match the info about duplicate messages that I learned from the tutorial with this sample.

I will quote one piece of the tutorial and 3 point in the source where I'd like some clarifications.

The tutorial says:
The ActorProxy class on the client side performs the necessary resolution to locate the actor by ID partition and open a communication channel with it. The ActorProxy also retries to locate the actor in the cases of communication failures and failovers. This ensures that messages will be reliably delivered despite the presence of faults. But this also means that it is possible for an actor implementation to receive duplicate messages from the same client.

So to me the problem seems that when you read messages coming into an actor from a client using actor proxy you should check for duplicates. That's ok for me.

Let's come to this sample. I'll pick 3 points I'd like to discuss.

  1. InventoryService.RemoveStockAsync
    In this function which is part of a reliable service we receive a message from an actor (customerOrderActor) that is accessing the service through Service.Proxy. Using a unique ID per request, a filter is implemented to avoid duplicate messages.
    But this is a service called through Service proxy, it's not a request coming to an actor called with Actor.proxy as the tutorial warned, so the risk of duplicates exists with both actor.proxy and service.proxy ?

  2. RestockRequestManagerService.RestockRequestCompleted
    this function running into RestockRequestManagerService is called from an actor, but the actor is not using the Service.proxy to reach the service, instead the actor is using an event previously registered by RestockRequestManagerService. No duplicate filtering is performed in RestockRequestCompleted. So when the communication happens through actor events there is no risk of duplicate messages?

  3. InventoryService.CreateInventoryItemAsync
    this function receive a request from WebService that uses ServiceProxy to access InventoryService. It could be similar to case 1 but no direct duplicate request filter is performed, maybe because the ReliableDictionary, where the request is stored, throw an exception if the same key (itemid) is added to the dictionary, so it act also as a duplicate filter. Did I get it right?

Sorry if the language is not too clear, I wrote in a hurry. I'd appreciate some insides from the experts to have a better understanding of the platform.

Thank you and once again congratulation for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant