Close Search Box
Search Box

Search: From:

Close
Newsletter

9Tutorials to your Inbox



Practical Implementation of MSMQ Using ASP.Net and SQL Server

Practical Implementation of MSMQ Using ASP.Net and SQL Server
Author lv1 (2000/5000)
2,708 views
1 Star2 Star3Star4 Star5 Star (2 votes, average: 5 out of 5)

Microsoft Message Queuing (MSMQ) technology enables applications running at different times to communicate across different networks and even the systems that may be available. MSMQ component delivery the message without file, efficient routing, security, reliable, and priority-based messaging. Even MSMQ handles both asynchronous and synchronous messaging type queuing.

Due to the high-speed networks, new requirement for technology to cater to a lot of high scale distributed applications. Now a day’s everything has to be fast and reliable even if the applications are not in the same location. To resolve this Microsoft introduced 3-Tier Arch. Even there is some many draw back in the 3-tier Arch, Consider a situation when so many people trying to register for a course in the university. Due to the over load server can’t able to response to the huge request. Because of that huge request, so many users request are rejected. To avoid this Microsoft Introduced MSMQ. MSMQ allows the application running at different times to communicate across different network and even the systems that may be available. It supports reliable transaction.
It enables the application to communicate across different network; even the server is temporally not available. Client Applications send and stores the messages to queues and read messages from queues.

What is a message?
A message is a collection data or chunk of information that is sent from a process running on client pc to other running process on the same or different computers on different network.

Queue?
Queues are nothing but First-In-First-Out (FIFO) data structures. Queues can be created using the MSMQ management tool through code or manually. Queues can be created and used dynamically. However you need to be aware of issues that might be caused by replication delays in the case of public queues. Private queues does not have such issues And there is no limitation for queues in MSMQ. You can able to create ‘n’ number of queues.

Types of Queues:

  • Public queues are those that are published in the MQIS and are replicated throughout the Enterprise. They can hence be located by any computer on the Enterprise.
  • Private queues on the other hand are not published in the MQIS and can only be accessed by systems that have access to the full path name or format name of the queue.
  • Store and Forward Communication
    It enables applications to send requests to other applications even the destination is unreachable at the same time. It queued (store) the application and process the request once the destination is reachable.
  • Concurrent Execution
    It allows sending request to heterogeneous network without getting acknowledged from the destination. We can also compare it with parallel process.
  • Guaranteed Message Delivery
  • Asynchronous communication
  • Transaction support
  • Message routing services
  • High scalability
  • Integration with Windows NT Security System

Where do we need?

MSMQ features

Sample Demo Application
This sample application to support people to register for application. And this application provide User interface using ASP.NET. Once the User completed entering the message and the message called the MessageQueue, which in turn call the “registration “ which is a private queue in my local system. A server Application implementing MSMQ provides the Message Processing by adding this information to a database and sending a response email.

Client Code to store MSMQ Message:

Code to retrieve from message from queue:

Steps to create private queue :

  1. Create a new Private Queue called “registrtion”
  2. Check the Transactional Queue check box in the Private Queue window.
  3. Create a new Trigger for Peeking, enabled, serialized, called “Registration”
  4. Create a new Rule called “reg_rule” with a Rule Condition of “Message Label contains registration”
  5. For the Rule Action, specify the path to the backend project executable (on my machine, this is “C:\CSHARPBIN\registration\backend\bin\Debug\backend.exe”
  6. In Parameters, pass the MessageId as Variant, and the MessageBody as String.
  7. In your Trigger’s attached rules, ensure that the Rule Notify is attached.
  8. Ensure that both the MessageQueue and the MessageQueue Trigger services are running.

Copyright @ Sathiyasivam  2007

del.icio.us:Practical Implementation of MSMQ Using ASP.Net and SQL Server digg:Practical Implementation of MSMQ Using ASP.Net and SQL Server spurl:Practical Implementation of MSMQ Using ASP.Net and SQL Server newsvine:Practical Implementation of MSMQ Using ASP.Net and SQL Server blinklist:Practical Implementation of MSMQ Using ASP.Net and SQL Server furl:Practical Implementation of MSMQ Using ASP.Net and SQL Server reddit:Practical Implementation of MSMQ Using ASP.Net and SQL Server blogmarks:Practical Implementation of MSMQ Using ASP.Net and SQL Server Y!:Practical Implementation of MSMQ Using ASP.Net and SQL Server magnolia:Practical Implementation of MSMQ Using ASP.Net and SQL Server segnalo:Practical Implementation of MSMQ Using ASP.Net and SQL Server
Login




Friends' Sites

Contact Us

Categories

Sponsors

Featured Links

Post a Comment »








Safari hates me

Comment Guidelines

  • Hyperlinks are automatically generated.
  • <em>italic</em>
  • <strong>bold</strong>
  1. Rajesh June 10, 2007

    Really good,

    I am statisfied with the article and the steps where clearly mentioned ….