我正在使用WCF MsMqIntegrationBinding,我正在尝试将我的消息写入远程队列。感谢Hugh和John Breakwell,我们能够让他们只使用正常的Messaging调用来编写,但是当我尝试将MsmqIntegrationBinding与WCF一起使用时,我似乎无法将其放入远程队列。我没有收到任何错误消息,它只是没有出现。
My other remote queue question
我添加了useSourceJournal以尝试查看该woudl是否有助于识别问题。
有什么想法吗?
将消息写入队列的代码。当队列是本地的时候工作......只是不是远程的:
for (int i = 0; i < 1; i++)
{
Console.WriteLine("Loop: " + i.ToString());
string path = ConfigurationManager.AppSettings["TestMessagesAll"];// @"D:\Demos\XmlMessages\";
string[] files = System.IO.Directory.GetFiles(path, "*.xml");
Parallel.ForEach(files, currentFile =>
{
string fileName = System.IO.Path.GetFileName(currentFile);
Console.WriteLine("Writing File {0}", fileName);
XElement xdoc = XElement.Load(path + fileName);
string xml = xdoc.ToString();
using (MessageClient strClient = new MessageClient("MessageResponseEndpoint"))
{
//MsmqMessage<XElement> strXmlMsg = new MsmqMessage<XElement>(xdoc);
MsmqMessage<string> strXmlMsg = new MsmqMessage<string>(xml);
strXmlMsg.Label = fileName;
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
{
strClient.SubmitStringMessage(strXmlMsg);
scope.Complete();
}
//Console.WriteLine(Environment.NewLine + "XML string has been submitted for processing:"
// + Environment.NewLine + "{0}", xdoc.ToString());
}
});
}
App Config:
<bindings>
<msmqIntegrationBinding>
<binding name="MessageProcessorBinding" useSourceJournal="true">
<security mode="None"/>
</binding>
</msmqIntegrationBinding>
</bindings>
任何建议都表示赞赏。
谢谢,
取值