MSMQ

R

Ronny

I'm trying to send objects via MSMQ from on application to the queue of
another. It doen't work.
Is there any example that shows that?
I need to send objects(class instances) using callbacks(and not event
notifications).
Regards
Ronny
 
S

Shane Rimmer

Are you receiving an error or is it just not working? Your application
needs write permission to the queue to put a message on it. The
MessageData object in the code below is a simple object in our system.

private void QueueMessage(MessageData msgData)
{
log.Debug("Adding new message to the queue");

System.Messaging.MessageQueue queue = new
System.Messaging.MessageQueue();
System.Messaging.BinaryMessageFormatter formatter = new
System.Messaging.BinaryMessageFormatter
(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full,
System.Runtime.Serialization.Formatters.FormatterTypeStyle.TypesAlways);

//Set the default properties for the queue
queue.Formatter = formatter;
queue.Path = ".\\private$\\queuename";

//Using Microsoft's javascript serializer
JavaScriptSerializer serializer = new JavaScriptSerializer
();
queue.Send(serializer.Serialize(msgData));
}
 
M

Mr. Arnold

Ronny said:
I'm trying to send objects via MSMQ from on application to the queue of
another. It doen't work.
Is there any example that shows that?
I need to send objects(class instances) using callbacks(and not event
notifications).
Regards
Ronny

If you're using .Net Framework 3.0 or higher, then you can use WCF
(Windows Communication Foundation) service with MSMQ between the WCF
client and the WCF server. You can send XML serialized objects between
the client app hosting the WCF client app and the server app hosting the
WCF server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top