msmq

Message Queues with different message types

我是研究僧i 提交于 2019-12-23 07:26:44
问题 I'm investigating Microsoft Message Queues for doing inter-process cross-network messaging. But when I receive a message, I don't know a priori what type of object I'm getting, so the code queue.Formatter = new XmlMessageFormatter(new Type[] { typeof(Wibble) }); can't be applied before I get the message because I don't know if it's a Wibble. So how do I receive different message types? 回答1: You might consider not storing your object in the MSMQ message, but instead putting a reference to it's

Reading MSMQ message count with ruby

徘徊边缘 提交于 2019-12-23 01:37:16
问题 I've got a problem querying the message count from the remote msmq queue. This is my code: def get_message_count mq_management = WIN32OLE.new('MSMQ.MSMQManagement') mq_management.Init('xxx.yyy.zz.aa', nil,'direct=tcp:xxx.yyy.zz.aa\private$\inbox') message_count = mq_management.MessageCount end xxx.yyy.zz.aa is the IP Address of the remote computer. This method actually works as a charm, BUT: if the queue is empty, then I keep getting this error after certain amount of time: `method_missing':

MassTransit MSMQ Pub with multi-sub. When is RuntimeServices ready?

醉酒当歌 提交于 2019-12-22 10:45:41
问题 I've set up a simple test comprising a publisher with two subscribers, all running on a single machine using MSMQ and MassTransit (2.1.1) RuntimeServices which is using a local Sql Server database. I've included the Bus set up code below so you can see what's set up. I'm starting each component manually and independently to try to workout what happens if a subscriber ins't running. I ran the two subscribers first so the queues and subscriptions are all set up and then quit them both, without

System.Messaging - why MessageQueue does not offer an asynchronous version of Send

纵然是瞬间 提交于 2019-12-22 08:05:43
问题 Would anyone know why System.Messaging is not offering an asynchronous version of the Send method to send an MSMQ message to a queue. Actually there is asynchronous version of Peek and Receive methods (via Begin/End pairs that can be converted to a C#5 async awaitable method), but surprinsingly there is no BeginSend/EndSend methods offered, just a Send method which seems to me like it's a synchronous blocking I/O call. I think this is not a limitation of System.Messaging but rather one of the

What is better approach to listen in MultiThreading Service?

China☆狼群 提交于 2019-12-22 07:50:13
问题 I am relatively new both to MSMQ and Threading in .NET. I have to create a service which listen in different threads, via TCP and SNMP, several network Devices and all this stuff run in dedicated threads, but here also is required to listen on MSMQ Queue from another applications. I am analyzing another similar projects and there is used next logic: private void MSMQRetrievalProc() { try { Message mes; WaitHandle[] handles = new WaitHandle[1] { exitEvent }; while (!exitEvent.WaitOne(0, false)

Ordered Delivery with netMSMQbinding

[亡魂溺海] 提交于 2019-12-22 06:41:56
问题 Is it possible to guarantee ordered delivery when using WCF netMSMQbinding? We are putting an insert command followed by a number of update commands on the same queue, and occassionally one of the updates beats the insert. Having added extensive logging it is clear that they are being added to the queue in the correct order and being processed in a different order. I have managed to Google a couple of articles that state that this behaviour is expected, but it seems like it must be possible

How do I set the MSMQ Message Extension Using BizTalk's MSMQ Adapter?

别说谁变了你拦得住时间么 提交于 2019-12-22 05:09:08
问题 We are using BizTalk Server to send messages via MSMQ. The receiving system requires that each message have the extension property set to a guid (as a byte array). MSDN documents the Extension property of the MSMQMessage here and (in .NET) here. It is simple to set the extension property in .NET: const string messageContent = "Message content goes here"; var encodedMessageContent = new UTF8Encoding().GetBytes(messageContent); // Create the message and set its properties: var message = new

Msmq and WCF Service

北城以北 提交于 2019-12-22 04:39:09
问题 I have created a WCF service using the NetMsmq binding for which i created a private queue on my machine and executed the project. This works fine as such and my WCF service is started and accesses the message using the queue in the debugging environment. Now, I wanted to host the service using the windows service and for the same I created a new project and windows installer as well (This service runs under Local System Account). Then I tried installing this windows service using the

How do I send/receive multicast messages using MSMQ?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 22:26:09
问题 Can someone please help me find some sample code to SEND and RECEIVE Multicast messages using MSMQ using any .NET language of your choice. I have searched around and kind of see the send being: MessaegQueue topic = new MessageQueue("formatname:multicast=234.1.1.1:8081") topic.Send("Hello out there") I tried to do the same idea with Receive: MessageQueue topic = new MessageQueue("formatname:multicast=234.1.1.1:8081") topic.Receive(); but I get nothing. Can anyone show some sample code on how

MSMQ Send message to Remote Queue

江枫思渺然 提交于 2019-12-21 09:27:40
问题 I am trying to send a message to a remote queue. My process isn't failing, but I still don't see the message on the remote queue? I would assume it would fail if it couldn't process the message? I did notice that on my local machine the remote queue is listed in Outgoing queues, but don't see messages there either. Very ignorant here and all examples show that how I am doing (or so I assume) is correct. Code (Simple for test): using (var transaction = new TransactionScope()) { using (var