sqlbroker将tcp测试路由到同一服务器

发布于 2024-11-03 01:14:23 字数 564 浏览 1 评论 0原文

出于测试目的,我将两个数据库放置在同一台服务器上,我想通过 TCP(而不是 GUID)在数据库之间发送排队消息。我是否仍然需要一个端点,因为它全部位于一台服务器上?我还使用 tcp://127.0.0.1:PORT 或 tcp://IP:port 吗?

最后,路由中的ReceivingService是目标数据库上的服务还是启动数据库上的服务?提前致谢!

CREATE ROUTE Route_to_Target_Database_On_Same_Server
WITH
BROKER_INSTANCE = '111F27B6-1211-10E1-1711-B1D19113121111',
SERVICE_NAME = 'ReceivingService',
ADDRESS = 'TCP://127.0.0.1:2044'


CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 2044 )
FOR SERVICE_BROKER (
ENCRYPTION = DISABLED);

For testing purposes, I placed two databases on the same server, I want to send queued messages between databases via TCP (not GUID.) Would I still need an endpoint since its all on 1 server? Also do I use tcp://127.0.0.1:PORT or tcp://IP:port?

Lastly is the ReceivingService in the route the service on the target database or the service on the initiating database? Thanks in advance!

CREATE ROUTE Route_to_Target_Database_On_Same_Server
WITH
BROKER_INSTANCE = '111F27B6-1211-10E1-1711-B1D19113121111',
SERVICE_NAME = 'ReceivingService',
ADDRESS = 'TCP://127.0.0.1:2044'


CREATE ENDPOINT BrokerEndpoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 2044 )
FOR SERVICE_BROKER (
ENCRYPTION = DISABLED);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清君侧 2024-11-10 01:14:23

我想通了。两者都有效。只需要小心防火墙/关闭的端口,并且两台机器上的权限都是正确的。如果在同一服务器上,则不需要端点,但如果其远程,则必须有端点(两者都具有正确的用户权限)

I figured it out. Both work. Just have to becarefull of firewalls/closed ports and permissions are correct on both machines. No need for endpoints if on same server, but if its remote then endpoints are a must (with correct user permissions on both)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文