Calling external services (Rest apis)/database CRUD operations within grain #6990
Replies: 1 comment 3 replies
-
This pattern is fine: you can call external services from an Orleans grain without concern. As you identified, blocking code can cause a problem with the .NET Thread Pool with or without Orleans being involved. In other words, the same code would cause a problem in an ASP.NET application or any other .NET application. Orleans schedules all operations using .NET's Blocking tasks using methods such as Messaging timeouts will occur if your HTTP calls exceed the configured maximum response timeout for your grain calls. It is highly recommended to profile any code intended for production under load to determine if there are blocking code paths or other inefficiencies. If you would like help analyzing CPU profiling traces, we can help. |
Beta Was this translation helpful? Give feedback.
-
Hello team,
I am using Orleans framework in one of our projects. This is the pattern of calls from our grains.
Domain Service ->
Calls CustomerGrain.Save() ->
Call1 from CustomerGrain - CustomerService.Save (external service) -> Saves customer information in sql server
Call2 from CustomerGrain - ProfileService.Save (external service) -> Saves customer recent activity in sql server
Call3 from CustomerGrain - Repo.Save ->
Call1 from Repo.Save - Calls Stored proc 1 to save in sql server
Call2 from Repo.Save - Calls Stored proc 2 to save in sql server
Would this call pattern cause any issues during high load?
Thanks
Dhananjay
Beta Was this translation helpful? Give feedback.
All reactions