Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 41,686 times

Contents

Related Categories

Get the Message - MSMQ - What is a Message Queue?

LACanadian

What is a Message Queue?

One of the underlying premises behind message queues is that you are working on a distributed application. If your entire application is capable of running in a single executable, then don't waste your time with this article (other than as an opportunity to learn). If you do have a distributed application, then there are a number of issues with which you must contend. Ones that you are probably already aware of - integration with legacy systems and network reliability.
Since the term legacy system has a different meaning depending on whom you talk to, let me give you mine quickly. A legacy system is one that has a database interface that is markedly different than the one that will be used on your current database. We realize that this is not the classic definition, but it is necessary for our exercise, since a newly developed application on a foreign database is still one with which we need to integrate. Our definition includes such an application in our scope of the problem.

The issue with legacy systems in our narrowly defined world is how do we access business rule procedures that may already be defined in these systems. We certainly don't want to rewrite into Visual Basic the accounts receivable system that has been developed over many years on an AS400. And simply having access to the data won't solve our problem since the rules are probably implemented in an archaic language, like COBOL or (gasp) RPG. So the question of how do we communicate with the AS400 at the business rule level.

With respect to network reliability, we're sure that none of you have any issues with the uptime of your network. In other words, whenever you request that some kind of transaction take place on a remote system, it happens immediately, and with no latency of any kind. Hands up all who qualify. Didn't think so. This problem is compounded when you try to run your environment across a wide area network or the Internet. So how do we ensure that the transactions we require are actually performed? The answer to both of these problems lies in message queues.

Consider a message queue to be like an in box on your desk. As people come up with work for you to do, they put the request into the pile on your in-tray. As you finish whatever task you are currently working on, you reach into you tray and pull out the next task to work on. Since you are a fair person, you perform the tasks on a first come, first served basis. What you have built is a message queue, albeit a manual one.

There are two basic functions in a computer-based message queue. First is a mechanism that allows one process to place a message into a queue. The second occurs when another process retrieves a message from the queue. The true beauty of the solution is that the two processes can not only be on different machines but running under different operating systems. It is this ability that allows message queues to transcend the problem with connecting to legacy systems.

The other principal attribute of a message queue is that the delivery of the message is guaranteed. In other words if a message is sent to a queue and the system on which the receiving process would be found is not running, the message remains in the queue. Then when the receiving system comes back to life, the message is sitting there waiting to be processed.

There are a number of other benefits offered by using a message queue. One of the main ones is the ability to scale your application by adding machines as the load demands it. The message queues that we are discussing can have messages added by more than one system. For example, if you are running a web site on a sever farm with a load balancing application to apportion the requests as they come in, query and update requests could come from any one of the web servers. And on the back end, you may want to have more than one server handle the middle tier (i.e. business rules) of your application. By using a message queue, you can have each of the web servers feed a single queue. Then as each middle tier server finishes its previous task, it can take the incoming requests from the queue and process them on a first come, first served basis. Additional processing power is created by tying new machines to either the load balancing application or the message queue with a minimal impact on the design of the application.

Another benefit of message queues can be derived if a portion of your computing environment is mobile. You can easily design a standalone application that allows salespeople to enter order information onto their laptop computers while they are sitting in the client's office. These orders are placed into a message queue that resides on their computer. Once they connect up to the corporate network, the guaranteed delivery portion of message queuing causes the entered orders to be updated to the central database. And all of this processing happens with no active action taken by the user, other than dialing into the network.

I am the owner of a small application development consulting company that specialized in the design and implementation of Internet-based applications. While there are others who can make a web site look good, our expertise is in making the site function. This includes infrastructure design, database design and administration, software development and deployment. For the most part, we utilize Microsoft-based languages and tools. And we are skilled enough to have generated two patent applications for our clients.

Comments

  • enableNotification in MSMQ using vb.net

    Posted by shahidnoor86 on 29 Jul 2008

    I am using MSMQ-3 on my local machine. I am using enableNotification method to notify me when a message comes in the queue. But i am getting error message while using enableNotification. The messag...

  • XML sample

    Posted by mightytookDev on 08 Dec 2004

    Ummm, there's a lot of other stuff around the code that I have (which was in a VB.DLL used within ASP pages), but I tried to pull out the working code that would get to the essence of what you need. E...

  • How to send and receive an XML file in a message q

    Posted by CyberLotus on 08 Dec 2004

    Hi,

    Could you please let me know, how to send an xml file as an object to a message queue? If possible can you provide me any code snippet for this as I'm novice to this technology.

    Also, I want...

  • MSMQ

    Posted by thongfam on 21 Sep 2004

    Hi,


    I have similar error "The operation is not supported on a workgoup installation of computer" while testing MSMQ program. I am using VB6 to write the MSMQ program. Do you have any advise on h...

  • MSMQ

    Posted by gdiazzap on 25 May 2004

    I need to Know hoy many messages are in a MSMQ Queue using API, WMI or OCX component using Visual Basic
    Any Idea?

    Gabriel