Microsoft MSMQ Connector Reference | MuleSoft Documentation
# Microsoft MSMQ Connector Reference
Anypoint Connector for Microsoft Message Queuing (MSMQ) (MSMQ Connector) uses a typical client-server architecture with two tiers, the connector or client running in the Mule Runtime, and the Windows Gateway running on the server side. The latter exposes an HTTP Web API for sending or receiving messages from MSMQ.
## Before You Begin
Ensure you have the following:
  * Java 8, 11, or 17
  * Anypoint Studio 7.5 and later
  * Mule runtime engine (Mule) 4.3.0 and later
  * DataWeave


## MSMQ Receiver Configuration
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The name for this configuration. Connectors reference the configuration with this name.  
Connection | The connection Types that can be provided to this configuration.  
Message Count  
Polling Frequency | The polling frequency in milliseconds to pull messages out of the gateway.  
Message Formatter |  Enumeration, one of:
  * ActiveXMessageFormatter

| The MSMQ message formatter to use to encode or decode messages.  
Message Delivery |  Enumeration, one of:
  * NoAcknowledgement
  * AtLeastOnce

| The message delivery mode when receiving messages from the Gateway.  
Expiration Policy |  ExpirationPolicy | Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime purges instances as it sees fit.  
### MSMQ Connection Type
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Gateway Service Address  
Gateway Access Token  
Queue Name (optional) | Queue name in UNC Path or FormatName notation, for example `.\private$\myqueue`  
Impersonation Username (optional)  
Impersonation Password (optional)  
Ignore SSL Warnings  
Reconnection |  Reconnection | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.  
#### Associated Sources
## MSMQ Sender Configuration
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
The name for this configuration. Connectors reference the configuration with this name.  
Connection | The connection Types that can be provided to this configuration.  
Message Formatter |  Enumeration, one of:
  * ActiveXMessageFormatter

| The MSMQ message formatter to use to encode or decode messages.  
Expiration Policy |  ExpirationPolicy | Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. The runtime purges instances as it sees fit.  
### MSMQ Connection Type
#### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Gateway Service Address  
Gateway Access Token  
Queue Name (optional) | Queue name in UNC Path or FormatName notation, for example `.\private$\myqueue`  
Impersonation Username (optional)  
Impersonation Password (optional)  
Ignore SSL Warnings  
Reconnection |  Reconnection | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.  
#### Associated Operations
## Send Operation
`<msmq:send>`
Sends the specified message to the queue.
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Queue Name  
Message Formatter |  Enumeration, one of:
  * ActiveXMessageFormatter

| The message formatter.  
The message to be sent. | `#[payload`]  
Impersonation Username | (Optional) If entered, the user name of the user to impersonate when accessing the MSMQ. The userName should be in the formats: local computer user: `[username]` or domain user: `[DOMAIN]\[username]`.  
Impersonation Password | (Optional) If entered, the password of the user to impersonate when accessing the MSMQ.  
Time to be received | (Optional) Message lifetime in seconds. 0 means the message does not expire.  
Time to reach queue | (Optional) Interval in seconds that represents the time a message can take to reach the destination queue from the gateway. 0 means the message does not expire.  
Additional Headers | Additional HTTP headers.  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors.  
### For Configurations
  * msmq-sender-config


### Throws
  * MSMQ:CONNECTIVITY
  * MSMQ:RETRY_EXHAUSTED


## Sources
### Msmq
`<msmq:msmq>`
### Parameters
Name | Type | Description | Default Value | Required  
---|---|---|---|---  
Configuration | The name of the configuration to use.  
Redelivery Policy |  RedeliveryPolicy | Defines a policy for processing the redelivery of the same message.  
Streaming Strategy | 
  * repeatable-in-memory-stream
  * repeatable-file-store-stream
  * non-repeatable-stream

| Configure to use repeatable streams and their behavior.  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| A retry strategy in case of connectivity errors.  
### Output
Attributes Type  
---  
### For Configurations
  * msmq-receiver-config


## Types
### Reconnection
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Fails Deployment | When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.  
Reconnection Strategy | 
  * reconnect
  * reconnect-forever

| The reconnection strategy to use.  
### Reconnect
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
How often to reconnect (in milliseconds)  
The number of reconnection attempts to make  
If false, the reconnection strategy runs in a separate, non-blocking thread  
### Reconnect Forever
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
How often in milliseconds to reconnect  
If false, the reconnection strategy runs in a separate, non-blocking thread  
### Expiration Policy
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max Idle Time | A scalar time value for the maximum amount of time to allow a dynamic configuration instance to be idle before being eligible to expire.  
Time Unit |  Enumeration, one of:
  * NANOSECONDS
  * MICROSECONDS
  * MILLISECONDS
  * SECONDS
  * MINUTES
  * HOURS

| A time unit that qualifies the maxIdleTime attribute.  
### Redelivery Policy
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max Redelivery Count | The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message.  
Use Secure Hash | Whether to use a secure hash algorithm to identify a redelivered message.  
Message Digest Algorithm | The secure hashing algorithm to use. If not set, the default is SHA-256.  
Id Expression | Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false.  
Object Store |  ObjectStore | The object store where the redelivery counter for each message is going to be stored.  
### Repeatable In Memory Stream
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Initial Buffer Size | The amount of memory to allocate to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.  
Buffer Size Increment | This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, which means that a STREAM_MAXIMUM_SIZE_EXCEEDED error occurs when the buffer is full.  
Max Buffer Size | This is the maximum amount of memory to use. If more memory is used, a STREAM_MAXIMUM_SIZE_EXCEEDED error occurs. A value lower or equal to zero means no limit.  
Buffer Unit |  Enumeration, one of: | The unit in which all these attributes are expressed.  
### Repeatable File Store Stream
Field | Type | Description | Default Value | Required  
---|---|---|---|---  
Max In Memory Size | Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it starts to buffer the content on disk.  
Buffer Unit |  Enumeration, one of: | The unit in which maxInMemorySize is expressed.  
## See Also
  * MSMQ Connector Overview
  * Windows Gateway Services Configuration Guide
  *