Connect to a remote queue through the hosts file

I have different environments for my application (Dev -> Test -> Prod) and I use MSMQ.

I also have the name of the queues (these are remote queues) that I use through configuration files in the following format:

FormatName:Direct=SERVER_NAME\Private$\MY_QUEUE

My problem is that SERVER_NAME is different in different environments, and I would like to delegate this problem to the server (i.e. for databases, I have aliases with the same name on all 3 servers, and each of them points to the actual db server )

I tried adding the queue server to the hosts file, but the following error failed:

The queue does not exist or you do not have sufficient privileges to perform the operation.

I tried FormatName:Direct, FormatName:OSandFormatName:TCP

Any help (workaround, new ideas on how to make this work) would be greatly appreciated.

The goal is to have one configuration file that will work in all environments.

+3
source share
3 answers

We also use the hosts file in our environment and find out (hard way) that MSMQ does not support. Our solution is to use an abstraction layer (ITransport) on top of MSMQ and let this layer replace host names (which can be found in the hosts file) with IP addresses. This is easy to do with the Dns class .

+3
source

This is just an assumption, and I cannot verify this at the moment, but:

, msmq Kerberos. . "" . , (). Windows "", , . , .

, . . (dev, qa production) . , , , , - , .

+2

. :

FormatName:Direct=OS:SERVER_NAME\Private$\MY_QUEUE

IP-:

FormatName:Direct=TCP:XXX.XXX.XXX.XXX\Private$\MY_QUEUE
0

Source: https://habr.com/ru/post/1722457/


All Articles