SQL SERVER – Change the Port of Service Broker Configuration

Just two day ago, I wrote small note about SQL SERVER – Introduction to Service Broker.

Yesterday I wrote article where Service Broker throws error due to it is using same port as other application SQL Server – Fix – Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process. One of the option was to configure Service Broker to different port than other application is using. I got couple of request to write how to do it.

I am writing two script where first End Point is created with specific port and required authentication and another script where End Point is dropped. This way Service Broker can be configured on different port.

Script 1: Create Service Broker End Point

USE master;
GO
CREATE ENDPOINT BrokerEndpoint
STATE
= STARTED
AS TCP ( LISTENER_PORT = 5000)
FOR SERVICE_BROKER ( AUTHENTICATION = WINDOWS ) ;
GO

Script 2 : Drop Service Broker End Point

If any user know how to just change the port without creating and dropping Service Broker End Point, please suggest your method.

USE master ;
GO
DROP ENDPOINT BrokerEndpoint ;
GO

Reference : Pinal Dave (http://blog.SQLAuthority.com), Book Online

About these ads

2 thoughts on “SQL SERVER – Change the Port of Service Broker Configuration

  1. Pingback: SQL Server - Fix - Error : 9692 The _MSG protocol transport cannot listen on port because it is in use by another process.Journey to SQL Authority with Pinal Dave

  2. Mr Dave,
    You can use the Alter statement like the following:

    ALTER ENDPOINT BrokerEndpoint
    AS TCP (LISTENER_PORT = 53000)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s