SQL Server: create and check the Service Broker endpoint
Create the Service Broker TCP endpoint (port 4022) and check its state through sys.tcp_endpoints.
When Service Broker no longer receives messages from another instance (endpoint missing, stopped or disabled), create the Service Broker endpoint and then check its state.
CREATE ENDPOINT [SSBEndpoint]
STATE = STARTED
AS TCP (LISTENER_PORT = 4022, LISTENER_IP = ALL)
FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS);
Check the state:
SELECT name, protocol_desc, type_desc, state_desc, port
FROM sys.tcp_endpoints
WHERE type_desc = 'SERVICE_BROKER';
Explanation
STATE = STARTED: the endpoint listens immediately;state_descshould readSTARTEDin the check query (STOPPEDorDISABLEDshows what needs fixing).LISTENER_PORT = 4022: TCP listening port (usual value, adjust as needed); it must be open in the firewall.AUTHENTICATION = WINDOWS: Windows authentication between instances.- If the endpoint already exists but is not started, use
ALTER ENDPOINT [SSBEndpoint] STATE = STARTED;instead of recreating it.