SQL Server : créer et vérifier l'endpoint Service Broker
Créer l'endpoint TCP Service Broker (port 4022) et contrôler son état via sys.tcp_endpoints.
Quand Service Broker ne reçoit plus de messages d'une autre instance (endpoint absent, arrêté ou désactivé), on peut créer l'endpoint Service Broker puis vérifier son état.
CREATE ENDPOINT [SSBEndpoint]
STATE = STARTED
AS TCP (LISTENER_PORT = 4022, LISTENER_IP = ALL)
FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS);
Vérification de l'état :
SELECT name, protocol_desc, type_desc, state_desc, port
FROM sys.tcp_endpoints
WHERE type_desc = 'SERVICE_BROKER';
Explications
STATE = STARTED: l'endpoint écoute immédiatement ;state_descdoit valoirSTARTEDdans la requête de contrôle (STOPPEDouDISABLEDindique l'état à corriger).LISTENER_PORT = 4022: port TCP d'écoute (valeur usuelle, à adapter) ; il doit être ouvert dans le pare-feu.AUTHENTICATION = WINDOWS: authentification Windows entre les instances.- Si l'endpoint existe déjà mais n'est pas démarré, utiliser
ALTER ENDPOINT [SSBEndpoint] STATE = STARTED;plutôt que de le recréer.