MessagePropertyFilter.DefaultBodySize Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the size, in bytes, of the default body buffer.
public:
property int DefaultBodySize { int get(); void set(int value); };
[System.Messaging.MessagingDescription("MsgDefaultBodySize")]
public int DefaultBodySize { get; set; }
[<System.Messaging.MessagingDescription("MsgDefaultBodySize")>]
member this.DefaultBodySize : int with get, set
Public Property DefaultBodySize As Integer
Property Value
The default body buffer size to create when the message is received. The default is 1024 bytes.
- Attributes
Exceptions
The assigned value is negative.
Examples
The following code example demonstrates the use of the DefaultBodySize property.
// Set the filter's DefaultBodySize
// property to 2048 bytes.
queue->MessageReadPropertyFilter->
DefaultBodySize = 2048;
// Display the new value of the filter's
// DefaultBodySize property.
Console::WriteLine(
"MessageReadPropertyFilter.DefaultBodySize: {0}",
queue->MessageReadPropertyFilter->DefaultBodySize);
// Set the filter's DefaultBodySize property to 2048 bytes.
queue.MessageReadPropertyFilter.DefaultBodySize = 2048;
// Display the new value of the filter's DefaultBodySize property.
Console.WriteLine("MessageReadPropertyFilter.DefaultBodySize: {0}",
queue.MessageReadPropertyFilter.DefaultBodySize.ToString());
Remarks
The default body size specifies the number of bytes to allocate for the message's body contents. The Body property of the Message class represents the serialized contents of the message. The body can contain up to 4 MB of data. Restricting the body size can improve performance.