0

We have a set of WCF services that use to MSMQ. We use the static web.config file to indicate to the services where the MSMQ host is.

Moving to AWS, we now need to dynamically specify the MSMQ host address. We figure we can pick between 2 options:

1) Write a script to update the web.config files when spinning up the AWS instances.

2) Drop the config files and implement a helper function that will resolve the MSMQ host address at runtime.

Anyone has any insight on what approach would be better or be considered best practice?

Thanks!

4

1 回答 1

0

我们最终使用了解决方案#1。这是一个简单的脚本,现在我们可以在 web.config 文件中的任何地方使用环境变量(不仅仅是设置 MSMQ 端点)。将 MSMQ 配置保存在 web.config 文件中还允许我们在需要时通过使用其他绑定(例如:RabbitMQ)来更改队列技术,而无需更改源代码。

于 2013-03-16T20:29:04.760 回答