Debugging Applications

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:

  1. Click the Start menu and navigate to Programs, Windows Azure Service Bus 1.0, Service Bus Powershell.

  2. Run the following cmdlet:

    Set-AzureSBRuntimeSetting -Name DebugMode -Value True
    
  3. 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.


Build Date:

2013-10-18

Community Additions

Show: