赞
踩
1.登录rabbitmq 点击nodes 的name。如下图
2.查看配置文件所在目录,如下图
3.打开配置文件,并填入如下一段
[
{rabbit,
[
{tcp_listeners, [{"192.168.40.116", 19042} ]} %%此处修改为你的 ip地址和 端口
]
}
].
4.在.net 程序中连接rabbitmq:
var factory = new ConnectionFactory { HostName = hostName, UserName= userName, Password= passWord, Port= port };
var connection = factory.CreateConnection();
var channel = connection.CreateModel();
ProducerChannel = channel;
ProducerChannel.ExchangeDeclare(ownerServiceName, ExchangeType.Direct);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。