NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Specifying Properties to Retrieve with a Message

Messages have a large number of properties, and filtering the properties you want to receive can enable you to focus on only that information that is relevant to you. For example, if you are not working with transactional messages, you might not want to retrieve the properties associated with transactions. In this case, you would set the MessagePropertyFilter properties IsFirstInTransaction, IsLastInTransaction, TransactionID, and TransactionStatusQueue to False. Your MessageQueue component would not retrieve any of the property values corresponding to these properties whenever it gets a message from a queue.

When you create an instance of the MessageQueue component, you can set a series of properties to indicate what properties you want to retrieve when the component gets a message from a queue. These properties exist in a class called MessagePropertyFilter, and correspond to actual properties on the Message class. When you set the value for one of these properties to True, the component will retrieve the corresponding property each time a message is removed from the queue.

For a full list of all of the properties you can set, see the MessagePropertyFilter Class.

To specify the properties to retrieve with a message

  1. Create an instance of the MessageQueue component and set its Path property to the queue to which you want to refer. For details, see Creating MessageQueue Components.
  2. Set the value for the MessageReadPropertyFilter member’s properties you want to receive to true.
    Note   You can use the SetAll method to set all the filter properties to true, or the ClearAll method to set all the filter properties to False.

See Also

Reading and Receiving Messages | Receiving Messages Programmatically | Peeking at Messages | Receiving Messages Asynchronously | Creating MessageQueue Components