开发者

How can I change the MSMQ response queue name format in NServiceBus?

开发者 https://www.devze.com 2023-02-07 04:30 出处:网络
I am trying to access an NServiceBus service on a work server from a client at home over a VPN connection. The messag开发者_Python百科e gets to the service OK but the response queue name has the forma

I am trying to access an NServiceBus service on a work server from a client at home over a VPN connection. The messag开发者_Python百科e gets to the service OK but the response queue name has the format

DIRECT=OS:MyHomePCName\private$\MyClientQueueName

The reply message sits in the server's outgoing queue presumably because it can't resolve MyHomePCName. Can I change the response queue name when sending the message to the following format?

DIRECT=TCP:MyHomeIPAddress\private$\MyClientQueueName

Of course I still have the problem of sending the IP address for the VPN connection, but I'm only testing at the moment and don't mind hard coding that in the client for now.


NSB should format it correctly if you put "$queueName@$homeIpAddress". Here is the code it uses:

public static string GetFullPath(string value){

IPAddress ipAddress;
if (IPAddress.TryParse(GetMachineNameFromLogicalName(value), out ipAddress))
{
    return (PREFIX_TCP + GetFullPathWithoutPrefix(value));
}
return (PREFIX + GetFullPathWithoutPrefix(value));

}

0

精彩评论

暂无评论...
验证码 换一张
取 消