The SagaAudit plugin enables the Saga View feature in ServiceInsight. It is built specifically to help developers verify Saga logic during development. It does this by capturing Saga message behavior and changes in Saga data/state as the Saga is being processed. It then sends this information to a ServiceControl endpoint setup in the development environment.
The SagaAudit plugin captures the following information:
- The incoming messages (including timeouts) that initiate change in the saga.
- The outgoing messages that the saga sends.
- A snapshot of the current saga data.
- The saga state
All this information is sent to and stored in ServiceControl. Note that the saga audit data is transmitted to ServiceControl via a message and is serialized using the built in JSON Serializer of NServiceBus.
This plugin results in an increase in load in several areas
- Endpoint load in order to capture the required information
- Network load due to the extra information sent to ServiceControl
- ServiceControl load in the areas of ingestion, correlation and data cleanup.
The increase in load is proportional to size of the saga data multiplied by the number of messages the the saga receives. Since both these variables are dependent on the specific saga implementation it is not possible to give accurate predictions on the impact of this load in a production system.
If using the older version of the plugin, namely ServiceControl.Plugin.SagaAudit remove the package and replace it with the appropriate plugin based on the NServiceBus version. This package has been deprecated and unlisted.
Plugins send messages using the defined endpoint transport to ServiceControl. The plugin must be configured with the location of the ServiceControl input queue. This queue is created during the installation of ServiceControl. It is based on the Windows Service name.
Configure the ServiceControl queue via config:
<appSettings> <add key="ServiceControl/Queue" value="particular.servicecontrol@machine" /> </appSettings>
var endpointConfiguration = new EndpointConfiguration("myendpoint"); endpointConfiguration.SagaPlugin( serviceControlQueue: "ServiceControl_Queue");
var endpointConfiguration = new EndpointConfiguration("myendpoint"); endpointConfiguration.DisableFeature<SagaAudit>();
If currently running the endpoint with the SagaAudit plugin in Production, do the following to remove it:
- Stop the endpoint.
- Delete the SagaAudit plugin dll from the endpoint's bin directory.
- If there is an automated deployment processes in place, ensure that this dll is no longer included.
- Restart the endpoint.
Doing so will stop sending the saga state change messages to ServiceControl reducing message load to ServiceControl. Turn it back on if or when needed.
To visualize the saga in Production and the plugin is not already deployed, then add the Saga Audit plugin in the same location where the saga is running and restart the endpoint. Use ServiceInsight to view the visualization and when done, follow the steps above to remove the plugin and restart the service.