Scenario
After a service is executed, user can re-run the service under the same execution environment in a Debugger or Integrated Development Environment (IDE). This is achievable as Symphony provides a feature (Service Event Replay Debugger) to save the service instance environment settings and the input events.
Replaying the service can be helpful for:
- Unit test of service code.
- Debug unexpected service errors or enviornment issues.
Steps Configuration:
1. Open the application profile (
SampleApp.cpp for example) in an editor.
2. In
Service section, add
debugSetting="full"
3. Save and register the application using
soamreg command.
Code:
<Service description="The Sample Service" name="SampleService"
debugSetting="full">
<osTypes>
<osType name="all"
startCmd="${SOAM_DEPLOY_DIR}/SampleServiceCPP"
workDir="${SOAM_HOME}/work">
</osType>
</osTypes>
</Service>
Exeucte service:
1. Run your client (AsyncClient for example).
Setup enviornment:
1. Locate your replay log file
1.1. Go to
work directory (
C:\SymphonyDE\DE40\work by default).
1.2. Go to directory
serl\app_name\service_name (
serl\SampleAppCPP\SampleService for example).
2. Run the
.env.bat script to setup the enviornment.
Replay service:
1. Launch debugger or IDE (Visual Studies for example) from the same shell or command window where you have set up the enviornment.
2. Run the service (set Service as "StartUp Project" if using VS), set break points where appropriate.
Notes - Replay logs are generated every time a service instance is ran, frequent clean-up might be required.
- User can configure for Symphony to only generate replay logs for certain events (such as service exit, exception, etc.) in specific methods, and do nothing if the service executes successfully. See reference document for details.
References
1. Developer's Guide -> Debugging and Troubleshooting -> Debugging a Service