简体   繁体   中英

NServiceBus. MSMQ message carries private IP of Response queue, but I need public

NServiceBus 5.2.14, NServiceBus.Host 6.0.0, MSMQ Transport, NHibernate Persistence

I need to setup communication between two endpoints via pub/sub. Both have static public IP. First is deployed on Azure Classic VM. Second currently is my dev PC.

I'm using "UnicastBusConfig" section for mapping commands and events to endpoint addresses, using public IPs in "Endpoint" attributes. Bus.Send() works as expected. But Bus.Publish() and Bus.Reply() tries to send messages to private IPs.

Subscription messages also carry private IP of subscriber (I've checked Subscription table).

Looks like all the messages send between these two endpoints (in both directions) captures sender's private IP for "Response queue". Here is an example of published event that got stuck in outgoing queue. Stuk event

Can I configure my endpoints to use custom address (public IP in my case) for event subscription messages at least (I can live without Bus.Reply()).

I've tried: 1. to use OverridePublicReturnAddress() extension of BusConfiguration; 2. attach IMutateTransportMessages implementation that sets "ReplyToAddress" header. But without any positive result.

您的Azure VM是否在同一个虚拟网络中,如果可以,则可以使用private进行一些通信。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM