Using the MSMQ Source Component

The MSMQ Source Component is an SSIS data flow pipeline component that can be used to read / receive data from Microsoft Message Queue.

The component includes the following two pages of configuration.

  • General
  • Columns

General Page

The General page allows you to configure various options that will help you receive messages from MSMQ. 

SSIS MSMQ Source Component

Connection Manager

The source component requires a connection to access a message queue.  The Connection Manager drop-down will show a list of all Kingswaysoft MSMQ Connection Managers and also Microsoft MSMQ Connection managers that have been created in the current SSIS package. 

Receive Mode

There are two different modes for available for receiving messages: Peek and Receive and Delete.  If the Peek option is selected messages will be received from the queue without deleting them or modifying the queue in any way.  If the Receive Messages and Delete option is selected messages will be retrieved and deleted from the queue.  It is only possible to select a listener mode if the receive mode is Receive and Delete.

Listener Mode
After the MSMQ component has retrieved all available messages from the queue it can continue to listen for more messages for a period of time.  There are three listener modes available.  The Fixed Time mode allows the component to listen for messages for a specified period of time.  The Wait Until mode allows the component to listen for messages until a specified date and time.  The Wait Until Variable mode allows the component to listen for messages until a date and time specified in a variable.  Listener modes other than None are only compatible with the Receive and Delete receive mode.

When new messages are detected in listener mode they may not enter the SSIS pipeline immediately; this depends on the buffer settings of the SSIS task.  Internally any row that is directed to an output goes to an SSIS buffer, and SSIS will not actually direct the rows in that buffer until the buffer is considered full, or the component has finished processing all of its data.  While in listener mode the component is considered to be processing data until the listener time has expired, which is when the full buffer is guaranteed to be completely processed.  To direct rows as fast as possible in listener mode consider lowering the DefaultBufferMaxRows property and DefaultBufferSize properties of the task to the lowest possible values.


The encoding that will be used to decode received messages.

Refresh Component Button 

Clicking the Refresh Component button causes the component to retrieve the latest metadata and update each field to its most recent metadata. It will remove any custom fields that have been added on the columns page.

Columns page

The Columns page shows you a default list of properties of messages that will be retrieved. You may indicate which columns to include in your source component by checking or unchecking the checkbox next to each attribute.  Additional columns can be added that correspond to other properties of incoming messages by clicking the 'Add' button.

SSIS MSMQ Source Component - Columns Page

Add Button
Clicking the Add button will bring up a dialog that will allow additional columns to be added that correspond to properties of incoming messages.

Notes about TimeToReachQueue and TimeToBeReceived columns: The type of these properties internally is a timespan, which can't be handled directly by SSIS.  By default the column that the component uses to output these values will be varchar (255), and will be a string representation of the timespan.  If you change the type of these columns to I8 in advanced settings the number of ticks in the timespan will be output.