MSMQ適配器的配置說明

來源:互聯網
上載者:User

 MSMQ適配器的地址格式:

MSMQ://FORMATNAME:Direct=tcp:192.168.6.16\private$\QueueName

 

對於IMSMQQueueInfo的PathName這個屬性,它只接受這樣的文法:

"myComputer\myPublicQueue"

"otherComputer\otherPublicQueue"

"myComputer\Private$\myPrivateQueue"

".\myPublicQueue"

".\Private$\myPrivateQueue"

而不接受這樣的IP標示:

xxx.xxx.xxx.xxx \private$\yourqname

因為並沒有可供使用的文法指明這個地址是IP地址,所以MS不支援這種寫法,會返回錯誤MQ_ERROR_ILLEGAL_PATHNAME (C00E0014)。

對於FormatName這個屬性,它才接受你的各種各樣DIRECT文法:

Direct=tcp:MyMachineHostName \private$\yourqname

Direct=tcp:xxx.xxx.xxx.xxx \private$\yourqname

               PUBLIC=QueueGUID

               DIRECT=Protocol:ComputerAddress\QueueName

               DIRECT=OS:ComputerName\private$\QueueName

PRIVATE=ComputerGUID\QueueNumber

因為它可以顯式指明使用的協議。

如果你不小心給FormatName這個屬性賦值

MyMachineHostName \private$\yourqname,那就會得到

MQ_ERROR_ILLEGAL_FORMATNAME (C00E001E)這個錯誤。

 

同樣,如果你不小心給PathName這個屬性賦值

direct=tcp:172.xx.xx.xx\private$\YourMQName,那就會得到

MQ_ERROR_ILLEGAL_PATHNAME (C00E0014)這個錯誤。

這兩個屬性真的不一樣啊,不要搞混了。

我的其他建議:

如果你原生MSMQ安裝模式是Workgroup模式:

只能使用.\private$\ YourPrivateMQName來訪問原生私人MSMQ隊列。

而不能使用.\ YourPublicMQName,即原生公用佇列你無法訪問,只有在AD模式下才可以訪問公用佇列。

謹慎起見,我進一步建議你不要在FormatName屬性上使用DIRECT文法,因為:

MSMQ1.0並不是完全支援DIRECT文法,MSMQ2.0才支援的。

最好用PathName屬性。

所以,一般請這麼使用PathName:

MyMachineHostName \ YourPublicMQName。

除非你要在Internet上訪問遠端MSMQ,再使用FormatName屬性指定對方IP地址。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.