Debugging Applications
Applies To: Service Bus for Windows Server 1.1
The Service Bus for Windows Server supports the ability to avoid the following scenarios:
A client remains connected to the service for a long time without any activity. The default timeout is 55 seconds.
Messages are locked by receivers for an indefinite time. The maximum PeekLock duration is 2 minutes.
These restrictions are necessary in a production environment, but they can be an impediment in a development environment. During application development, a developer needs the ability to set breakpoints in the code without the Service Bus enforcing the IdleTimeout or PeekLock restrictions.
The Service Bus for Windows Server enables you to control these settings in a development environment by using the Set-AzureSBRuntimeSetting PowerShell cmdlet. The cmdlet takes a parameter called DebugMode, with a value of either true or false. You can use the DebugMode setting to relax the timeout of both these settings for one day.
Using DebugMode
To enable the DebugMode parameter in a development environment, first ensure that the Service Bus for Windows Server is successfully installed and configured. Then do the following:
Click the Start menu and navigate to Programs, Azure Service Bus 1.0, Service Bus Powershell.
Run the following cmdlet:
Set-AzureSBRuntimeSetting -Name DebugMode -Value True
Run the following commands to restart the services and enable the settings to take effect:
Stop-AzureSBHost
Start-AzureSBHost
The client can now stay connected for one day before it is disconnected. Also, messages can now be locked by the receivers one day before the lock expires.