It may happen, that in some advance scenarios is required take more control about queuing mechanism of RFID stack. In this post I would like to show how to post the native message to the private queue of the process pipeline.
First important to know is that all events fired by underlying DSPI are collected by ProcessManager (an internal class) and posted in the private queue. Each process has two related queues. First one is used to collect events and the second one is used to persist suspended events.
Here is one example showing related queues for the process with the name "P3":
Following code shows how to post the event in the queue of the transactional process :
By using of this example please be aware of following:
1. The second parameter is the logical device name of the process. If you specify the name of unknown device (which is not bound to the process) the message will be moved to the suspended queue.
2. If the posting message is badly formatted following error will appear in the event log:
The RFID process engine P3 encountered an error of type UnknownFatalError. The service will attempt to restart this process engine automatically, unless this was because of a known fatal error. Additional information: System.InvalidOperationException: Cannot deserialize the message passed as an argument. Cannot recognize the serialization format.
at System.Messaging.BinaryMessageFormatter.Read(Message message)
at MS.Internal.Rfid.Service.Process.TransactionalEventProcessor.GetAndProcessMessage(Nullable`1& eventWithRoute, RfidEventBase& eventToBeProcessed, String& messageId)
at MS.Internal.Rfid.Service.Process.EventProcessor.ProcessEvent(). If this is due to a known fatal error, resolve the issue, and then start the provider or process manually.
Please note that the code shown in this post is not supported and described deserialization format may change it the future!
May 12 2008, 02:46 PM