473,462 Members | 1,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MSMQ reading message

Hi,
First venture into using MSMQ
Prog A owns queue and is receiving.
Prog B detects queue and sends message

Prog B appears to be working in that I can see the messages being created in
the Message console.
Prog A detects the message but I cannot get it to deserialise it.
It errors with 'Can't deserialise unknown format ' or words to that effect.
I just want to send the string "E".
In the message write I started simple with
myQue.send("E")
That didn't work so I went
to using an ActiveXFormatter to send and receive.
Result is still the same.
The help file indicates that you should be able to simply treat the body
like a string but my attempts to coerce it into a string have failed.
Any help on this would be appreciated.
Current code snippets follows.
Thanks
Bob

ProgA (RECEIVER)
Static qe As MessageEnumerator = q.GetMessageEnumerator

Dim msg As Message

qe.MoveNext()

Dim f As New System.Messaging.ActiveXMessageFormatter

Dim m As Object

msg = qe.RemoveCurrent

m = f.Read(msg)

ProgB (TRANSMITTER)

Dim mq As MessageQueue

Dim m As Message

m = New Message

Dim strMessage As String = "E"

Dim f As New System.Messaging.ActiveXMessageFormatter

f.Write(m, strMessage)

For Each mq In mqEvents

mq.Send(m)

Next


Nov 20 '05 #1
2 3879
Hi Bob,

I can not reproduce the problem with your code.
Based on my experience, the problem may be caused by received another
message in the message queue which is not the ActiveXFormatter, so the
error occur.

So I suggest you clear the messagequeue first and then use the code send a
message to the emply message and then stop the appliation, now we monitor
the message queue in the mmc console there should be one messge in the
queue.

Now we run the receiving application to receive the messge to see if we can
received the message and deserialize the content. Also now the messge queue
should has been emptied because we have called the removecurrent.

Here is a KB for your reference.
HOW TO: Write to and Read from Microsoft Message Queue Server in Visual
Basic .NET (315698)
http://support.microsoft.com/default...B;EN-US;315698

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 20 '05 #2
Hi Peter,
Thanks for your reply,
All is working now.
I have moved to using the XMLFormatter as per 'receiving messages
asynchronously'
regards
Bob

Peter Huang wrote:
Hi Bob,

I can not reproduce the problem with your code.
Based on my experience, the problem may be caused by received another
message in the message queue which is not the ActiveXFormatter, so the
error occur.

So I suggest you clear the messagequeue first and then use the code send a
message to the emply message and then stop the appliation, now we monitor
the message queue in the mmc console there should be one messge in the
queue.

Now we run the receiving application to receive the messge to see if we can
received the message and deserialize the content. Also now the messge queue
should has been emptied because we have called the removecurrent.

Here is a KB for your reference.
HOW TO: Write to and Read from Microsoft Message Queue Server in Visual
Basic .NET (315698)
http://support.microsoft.com/default...B;EN-US;315698

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Gordon | last post by:
I'm investigating getting Microsoft Navision to do stuff from a Python script. The recommended way seems to be to use message queues (MSMQ). I can get Navision to send a message to itself fine. I...
1
by: Na | last post by:
hi all: i'm new to msmq in C#, i 'm looking for a example of reading message once a new message coming (Event), but there are not C# examples in msdn, someone can help me or give me any good...
4
by: MSMQ workgroup and C# | last post by:
My MSMQ is in workgroup installation. I tried to add an event handler for the ReceiveCompleted event and to do It I try to use the SetPermissions. but I get an error of “A workgroup...
2
by: Przemo | last post by:
Hi, I want to send messages from one application to another, working on 2 different computers in a no-domain enviroment using private queues. Am I to place queue on the source or on the...
5
by: Alex Nitulescu | last post by:
Hi. I'm trying to make MSMQ work, so I go to Control Panel, Windows Components, I select MSMQ (Message Queuing Client Setup, actually) and about half-way through I get a nice message box saying ...
1
by: Leo Muller | last post by:
Okay, I got confused here. In order to get the messages out the MSMQ 3, on windows 2003, I need to invoke a COM component (ProgID). However, if I compile a class of .NET, and get a DLL, is this...
3
by: yonirabin | last post by:
Hello, I am building a system in C# 2.0 using the master - worker design pattern The system is supposed to work as follows: 1. The Master sends Command objects to several workers 2. All Commands...
11
by: Jon Davis | last post by:
Can a solution built in C# utilize MSMQ and/or MTS? If so, does this make the training material I already have on MSMQ and MTS in the context of VB6 an appropriate prerequisite foundation before...
1
by: Florence Tissot | last post by:
We are seeing some kind of resource leak in our performance lab running an ASP.NET (2.0) application that sends and receives messages from 2 public MSMQ queues. Here's a brief summary of what are...
0
by: ASPnewb1 | last post by:
Hello, I have a question about MSMQ as I'm new to using this system in the .NET framework. Here is my following application that I run 2 instances of to test the ability to communicate...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.