You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-fabric/service-fabric-best-practices-applications.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,8 @@ Save costs and improve availability:
54
54
## How to work with Reliable Services
55
55
Service Fabric Reliable Services enables you to easily create stateless and stateful services. For more information, see the [introduction to Reliable Services](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-introduction).
56
56
- Always honor the [cancellation token](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-lifecycle#stateful-service-primary-swaps) in the `RunAsync()` method for stateless and stateful services and the `ChangeRole()` method for stateful services. If you don't, Service Fabric doesn't know if your service can be closed. For example, if you don't honor the cancellation token, much longer application upgrade times can occur.
57
-
-Open and close [communication listeners](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-communication) in a timely way, and honor the cancellation tokens.
58
-
-Never mix sync code with async code. For example, don't use `.GetAwaiter().GetResult()` in your async calls. Use async *all the way* through the call stack.
57
+
-Open and close [communication listeners](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-communication) in a timely way, and honor the cancellation tokens.
58
+
-Never mix sync code with async code. For example, don't use `.GetAwaiter().GetResult()` in your async calls. Use async *all the way* through the call stack.
59
59
60
60
## How to work with Reliable Actors
61
61
Service Fabric Reliable Actors enables you to easily create stateful, virtual actors. For more information, see the [introduction to Reliable Actors](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-introduction).
@@ -64,16 +64,16 @@ Service Fabric Reliable Actors enables you to easily create stateful, virtual ac
64
64
- Make the actor state as [granular as possible](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-state-management#best-practices).
65
65
- Manage the [actor's life cycle](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-state-management#best-practices). Delete actors if you're not going to use them again. Deleting unneeded actors is especially important when you're using the [volatile state provider](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-state-management#state-persistence-and-replication), because all the state is stored in memory.
66
66
- Because of their [turn-based concurrency](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-introduction#concurrency), actors are best used as independent objects. Don't create graphs of multi-actor, synchronous method calls (each of which most likely becomes a separate network call) or create circular actor requests. These will significantly affect performance and scale.
67
-
- Don’t mix sync code with async code. Use async consistently to prevent performance issues.
68
-
- Don’t make long-running calls in actors. Long-running calls will block other calls to the same actor, due to the turn-based concurrency.
67
+
- Don't mix sync code with async code. Use async consistently to prevent performance issues.
68
+
- Don't make long-running calls in actors. Long-running calls will block other calls to the same actor, due to the turn-based concurrency.
69
69
- If you're communicating with other services by using [Service Fabric remoting](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-services-communication-remoting) and you're creating a `ServiceProxyFactory`, create the factory at the [actor-service](https://docs.microsoft.com/azure/service-fabric/service-fabric-reliable-actors-using) level and *not* at the actor level.
70
70
71
71
72
72
## Application diagnostics
73
73
Be thorough about adding [application logging](https://docs.microsoft.com/azure/service-fabric/service-fabric-diagnostics-event-generation-app) in service calls. It will help you diagnose scenarios in which services call each other. For example, when A calls B calls C calls D, the call could fail anywhere. If you don't have enough logging, failures are hard to diagnose. If the services are logging too much because of call volumes, be sure to at least log errors and warnings.
74
74
75
75
## IoT and messaging applications
76
-
When you're reading messages from [Azure IoT Hub](https://docs.microsoft.com/azure/iot-hub/) or [Azure Event Hubs](https://docs.microsoft.com/azure/event-hubs/), use [ServiceFabricProcessor](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/ServiceFabricProcessor). ServiceFabricProcessor integrates with Service Fabric Reliable Services to maintain the state of reading from the event hub partitions and pushes new messages to your services via the `IEventProcessor::ProcessEventsAsync()` method.
76
+
When you're reading messages from [Azure IoT Hub](https://docs.microsoft.com/azure/iot-hub/) or [Azure Event Hubs](https://docs.microsoft.com/azure/event-hubs/), use [ServiceFabricProcessor](https://github.com/Azure/azure-event-hubs/tree/master/samples/DotNet/Microsoft.Azure.EventHubs/ServiceFabricProcessor). ServiceFabricProcessor integrates with Service Fabric Reliable Services to maintain the state of reading from the event hub partitions and pushes new messages to your services via the `IEventProcessor::ProcessEventsAsync()` method.
Copy file name to clipboardExpand all lines: articles/service-fabric/service-fabric-diagnostics-how-to-monitor-and-diagnose-services-locally-linux.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ For more information, see the [code examples in GitHub](https://github.com/Azure
55
55
## Debugging Service Fabric C# applications
56
56
57
57
58
-
Multiple frameworks are available for tracing CoreCLR applications on Linux. For more information, see [GitHub: logging](http:/github.com/aspnet/logging). Since EventSource is familiar to C# developers,`this article uses EventSource for tracing in CoreCLR samples on Linux.
58
+
Multiple frameworks are available for tracing CoreCLR applications on Linux. For more information, see [.NET Extensions for Logging](https://github.com/dotnet/extensions/tree/master/src/Logging). Since EventSource is familiar to C# developers,`this article uses EventSource for tracing in CoreCLR samples on Linux.
59
59
60
60
The first step is to include System.Diagnostics.Tracing so that you can write your logs to memory, output streams, or console files. For logging using EventSource, add the following project to your project.json:
0 commit comments