Question about MSMQ with LLBL Entities

Posts   
 
    
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 10-Mar-2009 20:40:32   

I'm going to be using MSMQ to do some asynchronous processing, and in some cases the messages I will be queueing up will be a graph of entities.

I could use hand-coded DTOs, but I do need to represent relations between objects, so it makes more sense on the surface to just go ahead and use entities. Feedback on this would be welcome, but this is not my main question.

My main question is: is it possible to use fast serialization to read/write from MSMQ?

The message object in System.Messaging has a Formatter property that allows you to assign an instance of an IMessageFormatter. Is it possible to instantiate the fast serialization formatter and use it to format a message (which will only contain entities)?

I am assuming setting SerializationHelper.Optimization to fast won't affect sending messages to MSMQ?

Thanks,

Phil

(EDIT: using Adapter with version 2.6.8.903)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 11-Mar-2009 09:31:16   

fast serialization uses a normal Binary formatter, but takes over as soon as it starts calling ISerializable methods.

So if you plug in a normal binary formatter, it should simply serialize the data, at least that's what I would expect, so as soon as the binary formatter starts serializing the data, it will trigger the fast serialization code which will then take over.

Frans Bouma | Lead developer LLBLGen Pro
psandler
User
Posts: 540
Joined: 22-Feb-2005
# Posted on: 11-Mar-2009 14:37:53   

Awesome, thanks!