Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Davide Bedin
    How is Dapr using ports/connection pooling to interact with actors and state store?
    In a simple API -> Actor --> Actor interaction scenario, avoiding any external dependencies like messaging from API or Actors, with C# SDK, hosting in AKS with SQL Server as actor state store, in a load test we are reaching a plateau under many different conditions.
    As db did not experienced significant load, as well as the AKS VMs were not busy at all, we lastly investigated the network portion. Instead we faced high number of TCP connection errors to the Azure SQL Server.
    To sort out port exhaustion issues we configured the AKS LB via terraform to allocate 4K outbound ports, with 12 pods of two actor types spread over 6 nodes, we soon ended up with the LB maxing out the SNAT as seen below.
    2020-07-14 16_20_01-kubernetes _ Metrics.png
    Going back to initial question, how does Dapr implement connection pooling towards the (actor) state store? Is there any best practice we are missing?
    12 replies
    Christian Kaps
    Does the actor API work if a dapr app was started with --protocol grpc? I have an app that exposes a gRPC API and which contains also an actor. One of the methods of the gRPC API tries to execute this actor with the help of the ActorProxy. But I get the message: Dapr.Actors.DaprException: error finding address for actor type SubscriptionActor with id subscription. I have another app which does the same with an REST API. Also with starting the app with --protocol http. In this app the actor works as expected.
    8 replies
    Davide Bedin

    Under stress conditions of Actors in AKS we see emergence of significant volume of XmlSerialization exceptions, something similar to

    AddItemToCart    CatchResponseError('Error AddItemToCart: {errorCode":"ERR_ACTOR_INVOKE_METHOD"    message:"rpc error: code = Unknown desc = error from actor service: System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type WrappedMessageBody. Unexpected end of file. Following elements are not closed: Status     retVal     value     WrappedMsgBody.\\n ---> System.Xml.XmlException: Unexpected end of file. Following elements are not closed: Status     retVal     value     WrappedMsgBody.\\n   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader     String res     String arg1     String arg2     String arg3)\\n   at System.Xml.XmlExceptionHelper.ThrowUnexpectedEndOfFile(XmlDictionaryReader reader)\\n   at System.Xml.XmlBufferReader.ReadBytes(Int32 count)\\n   at System.Xml.XmlBinaryReader.ReadName(StringHandle handle)\\n   at System.Xml.XmlBinaryReader.ReadNode()\\n   at System.Xml.XmlBaseReader.Skip()\\n   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadIfNullOrRef(XmlReaderDelegator xmlReader     Type memberType     Boolean isMemberTypeSerializable)\\n   at ReadOperationResultFromXml(XmlReaderDelegator      XmlObjectSerializerReadContext      XmlDictionaryString[]      XmlDictionaryString[] )\\n   at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader     XmlObjectSerializerReadContext context)\\n   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader     String name     String ns     Type declaredType     DataContract& dataContract)\\n

    Stack trace truncated for brevity.
    Connecting to Dapr via port-forward during the stess test, we noticed that the content returned from Actors shifted significantly from one invokation to another
    While the result of

    GET HTTP/1.1

    Should have been always along the lines of:

    HTTP/1.1 200 OK
    Server: Kestrel
    Date: Mon, 20 Jul 2020 16:50:59 GMT
    Content-Type: text/plain; charset=utf-8
    Content-Length: 135
    Traceparent: 00-2290ba722bf7d5fd53f3696a48ed2ab2-d4d6f9637c966473-01
    Connection: close
      "UPC": "00091514",
      "ReplenishedQuantity": 71169,
      "OrderedQuantity": 26,
      "ReservedQuantity": 18,
      "UpdatedOnUTC": "2020-07-20T16:50:09.8078779Z"

    Instead, we received these results from the Dapr sidecar

    HTTP/1.1 200 OK
    Server: Kestrel
    Date: Mon, 20 Jul 2020 16:13:08 GMT
    Content-Type: text/plain; charset=utf-8
    Content-Length: 124
    Traceparent: 00-641fab238bb6b0b0dc3554aaa68e283b-b18aa7e1f70bd806-01
    Connection: close
    urn:actors    i)http://www.w3.org/2001/XMLSchema-instance@value.type�CommitReservationRespBody@retVal    a
    HTTP/1.1 200 OK
    Server: Kestrel
    Date: Mon, 20 Jul 2020 16:16:20 GMT
    Content-Type: text/plain; charset=utf-8
    Content-Length: 124
    Traceparent: 00-b134dcb13396ad79910d33bf83b90974-7e3f95589ba96b62-01
    Connection: close
    urn:actors    i)http://www.w3.org/2001/XMLSchema-instance@value.type�ReserveRespBody@retVal    a7http://sc

    I suppose this badly formatted content does explain the initially reported exception arising from the C# SDK.
    But shouldn't the Dapr sidecar prevent this partial content to be returned to the Dapr client/service/actor whatever?
    We found this #278 issue which might be related.

    19 replies
    Davide Bedin

    We configured our C# Actor with a 10 minutes ActorIdleTimeout, as this actor population is always increasing (new orders coming in) and we do not need them in memory after a while.

    actorRuntime.ConfigureActorSettings(a =>
                            a.ActorIdleTimeout = TimeSpan.FromMinutes(10);
                            a.ActorScanInterval = TimeSpan.FromSeconds(60);
                            a.DrainOngoingCallTimeout = TimeSpan.FromSeconds(35);
                            a.DrainRebalancedActors = true;

    In stress conditions on a AKS cluster, we see these errors coming from the pods of the aforementioned actor.

    time="2020-07-24T14:31:47.409449414Z" level=warning msg="failed to deactivate actor OrderActor||b40ac0ca-005d-4f29-a46d-cb31dff6b2f5: error from actor service: {\"error\": \"client error: dialing to the given TCP address timed out\"}" app_id=orderactor instance=orderactor-779b96d7fb-6qw29 scope=dapr.runtime.actor type=log ver=edge

    Looking at # errors VS new actors introduced per second, It seems that most of the actors meant to be deactivated translate 1:1 to this error being logged.
    Any hint on this?

    1 reply
    Miroslav Bartl
    Hello, could someone please give me an advice how actor IDs work? Will two actors of same type run in parallel if they have different or same actor IDs?
    1 reply
    Miroslav Bartl
    Hello, does anyone have an explanation why an actor reminder is firing twice "ReceiveReminderAsync", eventhough it is explicitly unregistered with "UnregisterReminderAsync" immediately after first call? The reminder is registered with 10sec timeout for both "dueTime" and "period"

    Hello, can somebody post or point to a sample of how actor supervision works in dapr/actors? Can I create a simple hierarchy like SupervisorActor - [1...n]ChildActor?

    In akka.net I can do
    public class SupervisorActor : ReceiveActor { IActorRef child = Context.ActorOf<ChildActor>("myChild"); }

    I can then monitor crashes of a child inside the supervisor. Is there a similar concept inside dapr/actors? I've seen some discussions here that dapr actors don't quite follow all these conventions, so perhaps it requires a different way of thinking about this problem.

    We would like for the Supervisor to be able to Queue work, meaning it saves state and sends a message to workers (child actors) which will handle long running jobs. The supervisor should not be held up though by the long running tasks.

    Yaron Schneider
    Hey @tstojecki, Dapr doesn't have the concept of child actors, but what you are trying to achieve is certainly doable as Dapr provides functionality to support this. In this case, you can have an actor that uses Dapr bindings to queue work items. You can then have a stateless service that uses Dapr input bindings to poll the queue and invoke the "child" actors.
    Adriano Santos
    I have the impression that Dapr actors are not really conceptually speaking actors. I may be mistaken. But it seems to me that they are abstractions different from those of the classic Actor Model
    Thanks @yaron2 and I agree @sleipnir. For newbies like myself it can be a bit of a surprise.
    @yaron2 so to run a long running job that isn't blocking the caller (whether it is another services or actor invoking the async LongRunningJob() on an actor), do you do that with Timers/Reminders?
    5 replies
    Richard Reukema
    As I understand it, we have Timers, Reminders, and now a CRON job . I was having a problem defining differenence of functionality between Timers and Reminders, but now CRON too? Do we have a clear defnition of each somewhere in the documentation?
    Nikolay Ganev

    Hey @yaron2 I have some problem with bindings when try create and use Actor with asp.net core like this:

        public async Task GET ([FromBody] JsonElement body)
            // Create an actor Id.
            var actorId = new ActorId("abc");
            // Make strongly typed Actor calls with Remoting.
            // DemoActor is the type registered with Dapr runtime in the service.
            var proxy = ActorProxy.Create<IDemoActor>(actorId, "DemoActor");
            string json = System.Text.Json.JsonSerializer.Serialize(body);
            data yourClass = JsonConvert.DeserializeObject<data>(json);
            await proxy.SaveData(yourClass);

    Binding working but when try use actor have this message
    An unhandled exception has occurred while executing the request.
    APP == Dapr.Actors.DaprException: error finding address for actor type DemoActor with id abc

    of cource actor service has statys running
    dapr run --port 3500 --app-id myapp --app-port 5001 dotnet DemoActorService.dll --components-path ./components
    Updating metadata for app command: dotnet DemoActorService.dll
    You're up and running! Both Dapr and your app logs will appear here.

    dapr list
    myapp 3500 51631 5001 dotnet DemoActorS... 4m 2020-08-10 14:17.49 39824

    Would you give any advice

    6 replies
    2 dapr questions I am hoping someone can chime in on
    1) lets say a method on a grain takes 2 seconds to respond, and 2 clients call into that actor at the same time, does the laggard get blocked for 2 seconds or is an error returned?
    2) in orleans there is the concept of a stateless grain/actor, basically will create an instance of that grain/actor on each node in the cluster, is this concept even relevant for dapr?
    I think I answered my question #1 above, sounds like the subsequent requests get blocked (probably up to some timeout limit) and do not just error out asap
    1 reply
    Jelle Bens
    An issue I am currently facing is that: if my redis pods (or some dependency )is not ready, my actors go into fault would it be possible to have readiness probe that probes x amout of times that e.g. my actopr store is still available?
    Hello, guys. I wonder where could find the documents of actors or how to use actors in Dapr.
    1 reply
    I only find this concepts.
    Is there information or specification on how to use go implement actor interfaces
    Yaron Schneider
    @abserari currently you can implement actors with Python, Java, and Dotnet. Go is on the roadmap
    Hi , guys . I wonder if the actor can subscribe topic ?
    4 replies
    Although I understand Dapr Actor is a programming model. I m struggling to see if there are 5 docker instances of Dapr.Actor running with sharded actors how would I make sure the request gets routed to correct actor instance; is there any documentation or details that I can refer to.
    5 replies
    Is there any example out there that shows how to build Dapr Actor cluster or perhaps just replicas of more than 1 Actor runtime instance. Anything further than this documentation would be helpful. https://github.com/dapr/docs/tree/master/concepts/actors#distribution-and-failover
    2 replies
    Amit Hansda

    I am having problem with deploying actors to my local kubernetes cluster. But when ActorClient tries to invoke anything with ActorProxy its throwing exception.

    Dapr.Actors.DaprException: context deadline exceeded
       at Dapr.Actors.DaprHttpInteractor.SendAsyncHandleUnsuccessfulResponse(Func`1 requestFunc, String relativeUri, CancellationToken cancellationToken)
       at Dapr.Actors.DaprHttpInteractor.SendAsync(Func`1 requestFunc, String relativeUri, CancellationToken cancellationToken)
       at Dapr.Actors.DaprHttpInteractor.InvokeActorMethodWithRemotingAsync(ActorMessageSerializersManager serializersManager, IActorRequestMessage remotingRequestRequestMessage, CancellationToken cancellationToken)
       at Dapr.Actors.Communication.Client.ActorRemotingClient.InvokeAsync(IActorRequestMessage remotingRequestMessage, String methodName, CancellationToken cancellationToken)
       at Dapr.Actors.Client.ActorProxy.InvokeAsync(Int32 interfaceId, Int32 methodId, String methodName, IActorRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken)
       at Dapr.Actors.Client.ActorProxy.ContinueWithResult[TRetval](Int32 interfaceId, Int32 methodId, Task`1 task)
       at MyActor.Service.WebClient.Controllers.TestController.SetDataAsync(String actorId, MyData model) in /source/MyActor.Service.WebClient/Controllers/TestController.cs:line 28

    I tried checking whether my redis statestore component is working or not. It is working, tested with another application in the local cluster.
    component YAML of my statestore is as follows.

    apiVersion: dapr.io/v1alpha1
    kind: Component
      name: statestore
      namespace: default
      type: state.redis
      - name: redisHost
        value: redis-master.default.svc.cluster.local:6379
      - name: redisPassword
          name: redis
          key: redis-password
      - name: actorStateStore
        value: "true"
    Young Bu Park
    @amitHansda I believe you may use 0.11.0 or 0.11.1. - We released the hotfix to resolve the issue - https://github.com/dapr/dapr/releases/tag/v0.11.2 please try with 0.11.2 release.
    Amit Hansda
    @youngbupark Thanks, 0.11.2 resolved this issue.
    Thomas Stegemann
    How does the performance look like compared to Akka.net? Especially on a local inprocess system?
    Sandeep Chandra
    Is there a real world example of dapr Actor in Asp.net core? I want to see how Actors can be used in Asp.net core web apis.

    I am currently facing the following error in my dapr application.
    It does not provide any information on what the reason for error is.
    Kindly provide any helpful suggestion.

    CLI: 11.0
    Runtime: 11.2

    [94;1m== APP == Dapr.Actors.DaprException: error from actor service: {"error": "client error: timeout"}
    ←[94;1m== APP == at Dapr.Actors.DaprHttpInteractor.SendAsyncHandleUnsuccessfulResponse(Func1 requestFunc, String relativeUri, CancellationToken cancellationToken) ←[0m ←[94;1m== APP == at Dapr.Actors.DaprHttpInteractor.SendAsync(Func1 requestFunc, String relativeUri, CancellationToken cancellationToken)
    ←[94;1m== APP == at Dapr.Actors.DaprHttpInteractor.InvokeActorMethodWithRemotingAsync(ActorMessageSerializersManager serializersManager, IActorRequestMessage remotingRequestRequestMessage, CancellationToken cancellationToken)
    ←[94;1m== APP == at Dapr.Actors.Communication.Client.ActorRemotingClient.InvokeAsync(IActorRequestMessage remotingRequestMessage, String methodName, CancellationToken cancellationToken)
    ←[94;1m== APP == at Dapr.Actors.Client.ActorProxy.InvokeAsync(Int32 interfaceId, Int32 methodId, String methodName, IActorRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken)
    ←[94;1m== APP == at Dapr.Actors.Client.ActorProxy.ContinueWithResultTRetval


    Design Question, caching proxy objects from ActorProxy.Create

    On DAPR I have 2 applications, high throughput asp.net + actors.

    1. App 1 - ASP.NET Core Controller connected to topics using Dapr connector for Eventhub.
    2. App 2 - Dapr Actor runnings on its own process.
      There are thousands of messages on the topic getting generated; a number of those for the same ActorId.

    guidelines/ question?
    Should I be creating proxy for each request.

       public async Task<bool> Save(AddDayActivityCommand request)
            return await ActorProxy.Create<IEmployeeDay>
                (new ActorId(request.EmployeeId), "EmployeeDay")  

    Or Can I add it to dictionary, and pull from there as needed.

    • Life cycle of an Actor Proxy?
      If I were to use Dictionary approach; would that reference to Actor be always correct?

    While would check for nulls (garbage collected), if it isn't null would it always point to correct ActorId, I m think rebalancing of nodes etc.

        private static readonly ConcurrentDictionary<string, IEmployeeDay> _employeeProxy = new ConcurrentDictionary<string, IEmployeeDay>();
        public async Task<bool> Save(AddDayActivityCommand request)  
          var actorProxy = getOrCreate(request.ActorId);  
          return await actorProxy.AddEmployeeDay(request);  
          static IEmployeeDay getOrCreate(string id)  
             var exists = _employeeProxy.TryGetValue(id, out var proxy);  
              if (exists && proxy != null) return proxy;  
              var employeeDay = ActorProxy.Create<IEmployeeDay>(new ActorId(id), "EmployeeDay");  
              _employeeProxy.AddOrUpdate(id, employeeDay, (s, ed) => employeeDay);  
              _employeeProxy.TryGetValue(id, out proxy);  
              return proxy;  
    Gutemberg Ribeiro
    hello folks!
    is there any plans to get proper DI support on the Actors?
    3 replies
    Alex Thissen
    Question on configuring the Actor runtime using .NET SDK: It seems that the UseActor(options => { options.ConfigureActorSettings ... is no longer available. What is the recommended way to change the settings now?
    Hi folks! Is there any way to cleanup the dapr state store for a specific actor? We've tried to delete the records in the daprState DB table but records keep coming back. Do I need to stop all actor services of this type to start with a clean slate after the cleanup?
    Pim Kartner
    Hey, looking over the documentation it's unclear to me where state is stored for actors and how it is passed to my logic instances? Is it that state is stored in the dapr runtime and with every call to an actor the state is passed with the message to my container and then deserialized?
    1 reply
    Ekin Tiras
    I have a possible use case for dapr actors but I am unsure whether it's actually a good idea or not:
    We have a set of microservices that communicate via a message bus. Some of these Microservices are developed by a completely different entity and we can only influence the development to a certain extend (ask them to provide certain routes etc.) but we handle the deployment to Kubernetes.
    Our Microservices have to access a variety of different Buckets and similar data sources. Currently we have to write a storage access module for each microservice.
    My idea is to take out the data access part entirely from the microservice and use Actors as an abstraction similar to a Repository Pattern, where our microservice and the developing team doesn't have to know anything about the implementation of the data storage (Buckets, File system, DB etc.)
    All they do is call the correct actor endpoint with a CRUD method. This would allow us to switch things around under the hood without touching any of our microservices.
    The general goal is to use dapr actors for any kind of functionality that is identical in most of our microservices and that is not covered by other dapr components. (A bit like layers in AWS lambda).
    Am I abusing the concept of actors in dapr with this use case or is there a better way to achieve this that I am unaware of? Especially the dependency between my microservice and the actor is something that worries me a bit.
    Rob Landers
    Hello, I've started building a PHP client (https://github.com/withinboredom/dapr-in-php) and currently implementing actors. I was curious how much like Orleans the actor implementation is. IOW, can there be more than one instance of the same (type, id) in a cluster, are there stateless actors, does dapr always call the same container for a given (type, id) until the actor is deactivated? Also, does anyone know a good reference implementation to look at?
    Rob Landers
    Also, this seems like a bug:
    5 replies
    Send a transaction with two upserts on the same key. In the first upsert, include a concurrency requirement and etag that will fail the requirement. The tranaction will fail, but the second upsert will still be committed, which doesn’t seem like a transaction at all (I would expect either all-or-nothing to be committed.
    Artur Souza
    @/all Please, consider joining our Discord server. We will deprecate our Gitter soon: https://github.com/dapr/dapr#contact-us
    Rob Landers
    @artursouza should probably consider updating the bottom of dapr.io, which is how I got here.
    When will the changes to support dependency injection in actors be available via nuget packages?
    Actor-to-Actor Communication? In this link https://docs.dapr.io/developing-applications/building-blocks/actors/actors-background/
    It states actors runtime can route messages between actors. What is the recommended way to do this?
    How can actor communicate with other actors (hopefully fire-and-forget style).
    Is there an equivalent of Actor.Tell<T>(T msg) similar to Akka.net?
    yellow chicks
    i want to know the difference between actors and invoke. such at "actors/{actorType}/{actorId}/method/{method}" and "invoke/{id}/method/{method:*}". i read dapr code to found the call synchronization by http request.
    Willem Meints
    Hi, I have a question regarding deactivating and cleaning up actor instances. Is there a way to say: I don't need this actor instance anymore, please clean it up?
    Krzysztof Woś

    In the actor example in Python SDK, the due_time and period in the Remindable interface appear to be the other way around:

            await self.register_reminder(

    The above seems to get me a reminder delivered immediately upon activation and then every 5 seconds

    Hi, I am working on an microservice application where services are long running processes and are written in different languages (c#, python...) so I cannot use hangfire for handling all those processes. Can I use dapr actors or some other building blocks for this kind of application to handle these processes as background jobs? I also want to observe all processes and in case of failures to restart them.
    Chino Chang
    Hello, everyone. I'm trying to run the .Net example for Actor with slim mode. But got DaprApiException. I've posted the logs and the configurations at dapr/cli#641.
    Aaron Crawfis

    Please move to Dapr Discord

    📢 The Dapr community has moved to Discord (https://aka.ms/dapr-discord). This Gitter community will no longer be monitored and maintained. Please post questions/comments over at Discord and we'll be happy to answer there!