Defines a binding that provides queuing support by routing messages through MSMQ.
<msmqIntegrationBinding> <binding closeTimeout="TimeSpan" customDeadLetterQueue="Uri" deadLetterQueue="Uri" durable="Boolean" exactlyOnce="Boolean" maxReceivedMessageSize="Integer" maxRetryCycles="Integer" name="String" openTimeout="TimeSpan" receiveContextEnabled="Boolean" receiveErrorHandling="Drop/Fault/Move/Reject" receiveTimeout="TimeSpan" receiveRetryCount="Integer" retryCycleDelay="TimeSpan" sendTimeout="TimeSpan" serializationFormat="XML/Binary/ActiveX/ByteArray/Stream" timeToLive="TimeSpan" useMsmqTracing="Boolean" useSourceJournal="Boolean"> </binding> </msmqIntegrationBinding>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements
|closeTimeout||A TimeSpan value that specifies the interval of time provided for a close operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.|
|customDeadLetterQueue||A URI that contains the location of the per-application dead letter queue, where messages that have expired or that have failed transfer or delivery are placed.
The dead letter queue is a queue on the queue manager of the sending application for expired messages that have failed to be delivered.
The URI that is specified by CustomDeadLetterQueue must use the net.msmq scheme.
|deadLetterQueue||A DeadLetterQueue.value specifying which type of dead-letter queue to use, if any
A dead-letter queue is the location that messages that have failed to be delivered to the application will be transferred.
For messages that require exactlyOnce assurance (i.e., the
For messages that require no assurances, this attribute defaults to
|durable||A Boolean value that indicates whether the message is durable or volatile in the queue. A durable message survives a queue manager crash, while a volatile message does not. Volatile messages are useful when applications require lower latency and can tolerate occasional lost messages. If the
|exactlyOnce||A Boolean value that indicates whether each message is delivered only once. The sender will then be notified of delivery failures. When
|maxReceivedMessageSize||A positive integer that defines the maximum message size, in bytes, including headers, that is processed by this binding. The sender of a message exceeding this limit will receive a SOAP fault. The receiver drops the message and creates an entry of the event in the trace log. The default is 65536. This bound on message size is intended to limit exposure to Denial of Service (DoS) attacks.|
|maxRetryCycles||An integer that indicates the number of retry cycles used by the poison-message detection feature. A message becomes a poison message when it fails all delivery attempts of all cycles. The default is 2. For more information, see MaxRetryCycles.|
|name||A string that contains the configuration name of the binding. This value should be unique because it is used as an identification for the binding. Starting with .NET Framework 4, bindings and behaviors are not required to have a name. For more information about default configuration and nameless bindings and behaviors, see Simplified Configuration and Simplified Configuration for WCF Services.|
|openTimeout||A TimeSpan value that specifies the interval of time provided for an open operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.|
|receiveErrorHandling||A ReceiveErrorHandling value that specifies how poison and nondispatchable messages are handled.|
|receiveRetryCount||An integer that specifies the maximum number of immediate retries the queue manager should attempt if transmission of a message from the application queue to the application fails.
If the maximum number of delivery attempts is reached and the message is not accessed by the application, then the message is sent to a retry queue for redelivery at a later time. The amount of time before the message is transferred back to the sending queue is controlled by
|receiveTimeout||A TimeSpan value that specifies the interval of time provided for a receive operation to complete. This value should be greater than or equal to Zero. The default is 00:10:00.|
|receiveContextEnabled||A Boolean that specifies if receive context for processing messages in queues is enabled. When this is set to
|retryCycleDelay||A TimeSpan value that specifies the time delay between retry cycles when attempting to deliver a message that could not be delivered immediately. The value defines only the minimum wait time because actual wait time can be longer. The default value is 00:30:00. For more information, see RetryCycleDelay.|
|sendTimeout||A TimeSpan value that specifies the interval of time provided for a send operation to complete. This value should be greater than or equal to Zero. The default is 00:01:00.|
|serializationFormat||Defines the format used for serialization of the message body. This attribute is of type MsmqMessageSerializationFormat.|
|timeToLive||A TimeSpan value that specifies how long the messages are valid before they are expired and put into the dead-letter queue. The default is 1.00:00:00.
This attribute is set to ensure that time-sensitive messages do not become stale before they are processed by the receiving applications. A message in a queue that is not consumed by the receiving application within the time interval specified is said to be expired. Expired messages are sent to special queue called the dead letter queue. The location of the dead letter queue is set with the
|useMsmqTracing||A Boolean value that specifies whether messages processed by this binding should be traced. The default is
|useSourceJournal||A Boolean value that specifies copies of messages processed by this binding should be stored in the source journal. The default is
Queued applications that want to keep a record of messages that have left the computer's outgoing queue can copy the messages to a journal queue. Once a message leaves the outgoing queue and an acknowledgment is received that the message was received on the destination computer, a copy of the message is kept in the sending computer's system journal queue.
|ByteArray||Serializes the object to an array of bytes.|
|Stream||The body formatted as a stream|
|<security>||Defines the security settings for the binding. This element is of type MsmqIntegrationSecurityElement.|
|<bindings>||This element holds a collection of standard and custom bindings.|
This binding element can be used to enable Windows Communication Foundation (WCF) applications to send messages to and receive messages from existing MSMQ applications that use either COM, MSMQ native APIs, or the types defined in the System.Messaging namespace You can use this configuration element to specify ways to address the queue, transfer assurances, whether messages must be durably stored, and how messages should be protected and authenticated. For more information, see How to: Exchange Messages with WCF Endpoints and Message Queuing Applications.
<configuration> <system.ServiceModel> <bindings> <msmqIntegrationBinding> <binding closeTimeout="00:00:10" openTimeout="00:00:20" receiveTimeout="00:00:30" sendTimeout="00:00:40" deadLetterQueue="net.msmq://localhost/blah" durable="true" exactlyOnce="true" maxReceivedMessageSize="1000" maxImmediateRetries="11" maxRetryCycles="12" poisonMessageHandling="Disabled" rejectAfterLastRetry="false" retryCycleDelay="00:05:55" timeToLive="00:11:11" useSourceJournal="true" useMsmqTracing="true" serializationFormat="Binary"> <security mode="None" /> </binding> </msmqIntegrationBinding> </bindings> </system.ServiceModel> </configuration>
Configuring System-Provided Bindings
Using Bindings to Configure Services and Clients
Queues in WCF