Service Broker required port

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 01:43:22

问题


Does anyone know if there is a port that absolutely has to be open on the SQL server to allow service broker traffic? We were testing what happens when you close off all ports on the SQL server except (1433, 445, 3389) and the query notification still worked. We were under the impression that 4022 has to be open for the service broker to work we a default listening port.

Is there a SQL system view that shows what port the service broker is communicating on?

Is there a command to terminate all active query notifications on a database so the database can be dropped?

Thanks


回答1:


If your service broker architecture is passing messages between servers (endpoints) then it will need ports other than the normal SQL ones.

If client code such as query notifications is accessing service broker then it uses SQL statements (with some new syntax) through the standard SQL connection and this part doesn't use any additional ports.




回答2:


From How to: Activate Service Broker Networking (Transact-SQL):

Service Broker does not send or receive messages over the network by default. To activate Service Broker networking in an instance, create an endpoint for Service Broker.

When you create an endpoint you specifically assign a port to use:

CREATE ENDPOINT BrokerEndpoint
    STATE = STARTED
    AS TCP ( LISTENER_PORT = 4037 )
    FOR SERVICE_BROKER ( AUTHENTICATION = WINDOWS );

Port 4022 is used when Service Broker communicates with other broker instances. How are you using Service Broker? If all the work is internal to your database then it never needs to use a TCP endpoint.




回答3:


Query Notification does not require a Service Broker endpoint because it always deliver the messages locally, int he same DB where you started the notifications from. Although configuring QN to deliver notifications to a remote machine is possible, ding so is basically unheard of. See The Mysterious Notification.

As for the question: Service Broker requires only the configured endpoint port to be open. You can see the listening port in sys.tcp_endpoints. If the configured authentication is Windows then the ports needed for Kerberos/NTLM (135, ?389) are also required in order to authenticate the SSB connections. Note that the SMB port (445) is not required by SSB ever. If SSB endpoint configured authentication is certificates then no additional port is required. See How does Certificate based Authentication work.



来源:https://stackoverflow.com/questions/8315795/service-broker-required-port

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!