How To - Tasks and Transformations: Message Queue Task

Written by Varigence Blog on 7.12.2011



My previous post returned to the theme of workflow tasks by discussing the SSIS Execute Package task, along with what Mist brings to the table. It’s now time to finish off the workflow tasks with the Message Queue task.


Microsoft Message Queuing (MSMQ) is a message queue implementation that’s existed in Windows operating systems for over 15 years. Its intent is to allow applications running on separate servers to communicate in a failsafe manner. From Wikipedia: “MSMQ is responsible for reliably delivering messages between applications inside and outside the enterprise. MSMQ ensures reliable delivery by placing messages that fail to reach their intended destination in a queue and then resending them once the destination is reachable.”

In terms of packages, MSMQ can be useful when two independent packages need to communicate with one another. For instance, if the outcome of one package’s execution needs to be communicated to another package. Of course, it’s possible to write to a message queue from any windows application; synchronization is not limited to just between packages.

In this post’s example, I’m going to walk through using the MSMQ task in BIDS and Mist to receive messages from the message queue. The scenario I’m picturing is that you have some application that performs required processing before your package should run. Thus, your package must wait to receive a message that processing is finished before executing.

Installing MSMQ:

To work through this sample, the computer where you run it must have MSMQ installed. If you’re unsure if MSMQ is installed, you can check by right clicking on My Computer and selecting Manage.

alt text here…

This opens the Computer Management console. Expand the Services and Applications node and check if a Message Queuing item is present. If it’s present, then MSMQ is installed. Otherwise, you need to install it.

At the end of this article, I've included a link to instructions for installing message queuing on Windows 7 and Server 2008 R2. Additionally, you can search online for installation instructions for other Windows operating systems.

Getting Started:

Because this sample involves messaging, and messages require a sender and receiver, I’ve written a very simple C# application that sends a message to a message queue. I’ve built the sample using Visual Studio 2010 although it can be run in .NET 2.0 or later.

The message generator application uses a hard-coded string for a message queue name, following the pattern of serverNameprivate$queueName. serverName is set to “.” to indicate the local server. The queue name is arbitrarily set to MsmqSample.

The message being sent is a simple text message of “My Msmq Sample”. The message also needs its label to be set so the MSMQ task can determine if the message matches one of its message types. In this case, the message’s Label property is set to “String Message.” See this MSDN forum post for more details.

When running, the application first checks if the message queue exists. If it does, it will send a message. If the queue doesn’t exist, it’s created and then the message is sent.

To confirm the application works, right click on My Computer and select Manage in the context menu. This opens the Computer Management console. Notice that under Services and Applications, there’s a Message Queuing directory.

Now, run the message generator application to send a message. To confirm the message was sent, right click on Private Queues and select Refresh. A new queue named msmqsample should appear. Expand its node to reveal its child items and select the Queue messages item.

alt text here…

Notice that in the center list, there is a single message. If you right click on the message and select Properties, a Properties dialog appears with detailed information about the message. If you select the Body tab, you’ll see the message’s body, confirming the intended message was sent.

alt text here…

With that working, it’s now time to discuss receiving the message within a package.

Using BIDS:

To get started with the Message Queue task, first find it in the Toolbox tool window.

alt text here…

Next, drag and drop the task onto the package’s design surface.

alt text here…

The red X icon indicates the task has errors. The Error List displays the following:

alt text here…

From the error list, it’s clear that the task requires a connection, which makes sense since it needs to be notified when a message is added to the message queue.

Double clicking on the Message Queue task brings up its properties dialog.

alt text here…

If you click inside the MSMQConnection field, you’ll see a down arrow button. Click on it to open a dropdown that invites you to create a new connection.

alt text here…

Click on “New connection” to open the MSMQ Connection Manager Editor.

alt text here…

The Path property needs to match the message queue path used in our message generator application, since this package will receive messages sent by the application. Enter the path in the Path text field.

alt text here…

The Test button verifies that the path is valid. Once a path is correctly entered, press OK to dismiss the dialog.

Next, in the Message property’s field, click on its value to open a popup. Switch the message’s type to Receive message.

alt text here…

As a result, in the dialog’s left list box, you can now click on the Receive item, which replaced the Send item.

alt text here…

The Receive page has several properties:

RemoveFromMessageQueue indicates whether to remove the message from the queue once it’s received. I suggest setting this to true to avoid having to remove messages manually.

TimeoutAfter lets you set a timeout, in seconds, for how long the task will wait if no message is received. The related ErrorIfMessageTimeOut property indicates whether an error message is displayed if timeout is reached.

The MessageType property indicates the message format that’s expected. You can choose from:

Format Description Data file message The message is in a data file Variable message The message is stored in a package variable String message The message is a string in the queue String message to variable The message is a string that will be saved to a variable The Compare property is set to None by default. However, you can set Compare to: Exact match, Ignore case, or Containing. These compare types indicate that the string message must meet the compare criteria for the Message Queue task to process them. Otherwise, the message is ignored.

With task set-up complete, press OK to dismiss the Message Queue Task editor dialog box. Build and Run the package in BIDS and, while it’s running, run the Message Generator application. The application will send a message to the queue. Your task should respond by turning green, as it successfully processes the message.

Using Mist:

To start, you’ll need to create a package. If you’re unfamiliar with how to create and open a package, you can follow the first couple steps in the Mist User Guide’s Creating a Package topic.

Once you’ve opened the package, navigate to the Toolbox tool window and find the Message Queue task.

alt text here…

Note that in the past, you’d have to search the treeview for the task you’re looking for. However, in an upcoming release, the Toolbox tool window has a search box so it’s easy to find the task you want.

Select and drag the Message Queue task onto the Package’s design surface.

alt text here…

The task has a red X icon indicating that it has errors.

alt text here…

The errors explain that Mist requires you to provide a MsmqConnection in the Message Queue task. To accomplish that, return to the logical view tool window, right click on the Connections group, and add a MSMQ connection.

alt text here…

Double click on the connection to open the connections editor.

alt text here…

In the Path field, enter the message queue path.

alt text here…

Then, reopen the package and select the Message Queue task. Click on the Package Details tab to see the properties for the task.

alt text here…

Looking at the details tool window, you can see that Mist mirrors the properties available in BIDS. Additionally, there are separate areas for both Send Message and Receive Message.

To assign the connection to the Message Queue task, open the MSMQ Connection dropdown and select MsmqConnection1.

alt text here…

To indicate that a received message should be removed from the queue, simply check the Remove from Queue checkbox.

Finally, right click on the package in the Logical View and select Build & Open in BIDS. That command will build your package and then open it in BIDS. You can then run the Message Generator and see that the task succeeds.


The BIDS and Mist examples demonstrated above, along with the Message Generator application, can be downloaded here.


Message Queue documentation for the Biml language

Message Queue task - MSDN

Install Message Queuing on Windows 7 and Windows Server 2008 R2



Written by Guest on 5/28/2020 3:25:46 AM

Dfjcqb jynwot male ed pills erectile dysfunction medication

Written by Guest on 5/28/2020 6:24:03 AM

Written by Guest on 5/28/2020 11:09:07 AM

Kcqzcp yooytw best ed pills non prescription erectile dysfunction pills

Written by Guest on 5/28/2020 2:49:21 PM

Привет дамы и господа<a href=>! Наша компания занимается свыше 10 лет изготовлением памятников из гранита в городе Минске.Основные направления и виды нашей деятельности:

1)<a href=>памятники из гранита минск

2)<a href=>изготовление памятников минск

3)<a href=>ограда на кладбище минск

4)<a href=>благоустройство могил минск

5)<a href=>благоустройство захоронений минск Всегда рады помочь Вам!С уважением, PRIME GRANIT

Written by Guest on 5/28/2020 10:16:48 PM

Written by Guest on 5/28/2020 10:37:27 PM

download zettai karen children sub indo download redsnow 0.7 download flv toolbar ihome download for ipod touch download cai verzi smiley [url=]mystic [/url] download dolly parton jolene catholic downloading music sin magellan download maps warcraft 1.26 a download download ahange sattar khatere download ipython notebook wolfenstein download free full version download strange negotiations download matisyahu album free download abdel wahab mp3

Written by Guest on 5/29/2020 2:13:47 AM

Written by Guest on 5/29/2020 5:04:25 AM

Ссылка на гидру | Гидра ссылка | Ссылка гидра онион | Гидра зеркало. [url=] Гидра ссылка >>>[/url]

Written by Guest on 5/29/2020 7:29:14 AM

Written by Guest on 5/29/2020 12:18:52 PM

Hi there! [url=]order fluoxetine[/url] prozac online <a href=>buy prozac

Written by Guest on 5/29/2020 2:34:40 PM

Written by Guest on 5/29/2020 2:53:55 PM

Written by Guest on 5/29/2020 3:55:28 PM

Written by Guest on 5/29/2020 4:06:54 PM

Салон красоты СЗАО Москва <a href=>Салон красоты СЗАО Москва

Written by Guest on 5/29/2020 4:15:15 PM

Written by Guest on 5/29/2020 9:03:17 PM

Written by Guest on 5/29/2020 10:44:47 PM

Hi there! [url=]legit online pharmacies[/url] meds online pharmacy

Written by Guest on 5/29/2020 11:16:03 PM

[b]SEE MY NEW VIDEO - "Oral creampie compilation, only Amateur cum mouth compilation" [/b] -

Related movies: older wives taking the first bbc wife first time with bbc cuckold real wife first bbc husband tapes amature wife try bbc 50 years mature wives shared blindfolded bbc real breeding impregnation white cuckold housewife asian multiple swallow husband anal wife japanese massage fuck nearby husband daugther interracial cum in mouth ... Watch Amateur MILF Quickie tube sex video for free on xHamster, with the superior collection of Amateur Tube MILF Md & MILF Vk HD porn movie scenes!

Written by Guest on 5/30/2020 3:33:28 AM

Written by Guest on 5/30/2020 7:36:41 AM

Салон красоты ЮАО Москва <a href=>Салон красоты ЮАО Москва

Written by Guest on 5/30/2020 8:46:51 AM

Written by Guest on 5/30/2020 11:24:57 AM

Written by Guest on 5/30/2020 1:09:42 PM <a href=>Салон красоты ЮВАО Москва

Written by Guest on 5/30/2020 4:14:51 PM <a href=>Салон красоты ЮЗАО Москва

Written by Guest on 5/30/2020 7:47:20 PM

Calls for more action on tuna overfishing, the report said. It said the country should not be doing more as a precautionary measure and should focus on improving the quality of ocean life through scientific research and sustainable management.

Tuna is increasingly viewed as a delicacy, but its meat was once valued by rich countries for its nutrients, particularly vitamin B1, the report said. The high cost of tuna for consumer consumption meant it was rare and expensive to catch. It has declined by 70 percent since the 1980s. [url=]바카라[/url] [url=]카지노[/url]

Cazaly taking the good with the bad, the good is better with the bad.

The only bad thing I could say with this is that we will have to see how much it makes the other actors more likable.

Written by Guest on 5/30/2020 11:18:59 PM

Written by Guest on 5/31/2020 2:11:20 AM

download mp3 complicated avril lavigne download cu1 for exchange 2013 download mt5 instaforex download amityville horror ebook download pubmed data [url=]sainted[/url] una mujer conforme al corazon de jesus cambia tu vida en solo 30 dias advances in mining graphs trees and sequences analysis and control of underactuated mechanical systems developing tactics for listening 2nd edition teacher goodweek tires inc case study solution download coisas que vivi download tГ­n nghД©a download p90x2 videos download pablo alborГЎn perdГіname acdsee free download full version

Written by Guest on 5/31/2020 7:26:51 AM

free to watch sex cams [url=]free women sex cams [/url] jerky sex cams mature.