Message Queuing and Asynchronous Inter Process Communication

Slides:



Advertisements
Similar presentations
MQ Series Cross Platform Dominant Messaging sw – 70% of market Messaging API same on all platforms Guaranteed one-time delivery Two-Phase Commit Wide EAI.
Advertisements

COM vs. CORBA.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins –
SQL Server Replication
Network Operating Systems Users are aware of multiplicity of machines. Access to resources of various machines is done explicitly by: –Logging into the.
Technical Architectures
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
Click to add text Introduction to z/OS Basics © 2006 IBM Corporation Chapter 15: WebSphere MQ.
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Distributed Architecture Philosophy Why asynchronous messaging?
Copyrighted material John Tullis 10/2/2015 page 1 04/02/00 MQ Series Middleware Presentation John Tullis DePaul Instructor
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Lecture 15 Introduction to Web Services Web Service Applications.
Asynchronous Communication Between Components Presented By: Sachin Singh.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
Alwayson Availability Groups
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Copyright © 2004, Keith D Swenson, All Rights Reserved. OASIS Asynchronous Service Access Protocol (ASAP) Tutorial Overview, OASIS ASAP TC May 4, 2004.
Sockets A popular API for client-server interaction.
Operating Systems Distributed-System Structures. Topics –Network-Operating Systems –Distributed-Operating Systems –Remote Services –Robustness –Design.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
MQ Series Cross Platform Dominant Messaging sw – 70% of market
Windows Communication Foundation and Web Services
Remote Procedure Calls
Tiny http client and server
Last Class: Introduction
CSE 486/586 Distributed Systems Consistency --- 2
How HTTP Works Made by Manish Kushwaha.
HTTP and Abstraction on the Internet
Alternatives to Mobile Agents
Web Development Web Servers.
Data Virtualization Tutorial… CORS and CIS
Principles of Network Applications
MVC and other n-tier Architectures
Out-of-Process Components
Chapter 9 – RPCs, Messaging & EAI
CHAPTER 3 Architectures for Distributed Systems
Working at a Small-to-Medium Business or ISP – Chapter 7
HTTP: the hypertext transfer protocol
#01 Client/Server Computing
Test Upgrade Name Title Company 9/18/2018 Microsoft SharePoint
Chapter 3: Windows7 Part 4.
Working at a Small-to-Medium Business or ISP – Chapter 7
Using the Parallel Universe beyond MPI
Ch > 28.4.
Replication Middleware for Cloud Based Storage Service
Packet Sniffing.
Information Systems in Organizations 2
What’s new in SQL Server 2016 Availability Groups
Working at a Small-to-Medium Business or ISP – Chapter 7
The future of distributed systems architecture
Lecture 1: Multi-tier Architecture Overview
Harjutus 3: Aünkroonne hajussüsteemi päring
Service-Oriented Computing: Semantics, Processes, Agents
Multithreaded Programming
Lecture 21: Replication Control
Message Queuing.
MQ Series Cross Platform Dominant Messaging sw – 70% of market
P1 : Distributed Bitcoin Miner
COMPONENTS – WHY? Object-oriented source-level re-use of code requires same source code language. Object-oriented source-level re-use may require understanding.
Out-of-Process Components
Chapter 5 Architectural Design.
Distributed Availability Groups
Lecture 21: Replication Control
CSE 486/586 Distributed Systems Consistency --- 2
Message Passing Systems Version 2
#01 Client/Server Computing
Message Passing Systems
QlikView for use with SAP Netweaver Version 5.8 New Features
Presentation transcript:

Message Queuing and Asynchronous Inter Process Communication An exposition on why and how to use .Net to introduce Message Queuing into your applications   23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Sub-title: How to make your applications appear to be really snappy when they’re actually dog-slow. 23/05/2019 Message Queuing - a walk on the wild side

What is Message Queuing? Message Queuing is a technique for implementing Asynchronous Inter Process Communication It’s an abstraction of a file-based persistence and network communication layer. 23/05/2019 Message Queuing - a walk on the wild side

What is Inter Process Communication? IPC is communication between two discrete processes, typically one of which provides some service to the other (but they could be equal partners, servicing each other). 23/05/2019 Message Queuing - a walk on the wild side

So what then is Synchronous Inter Process Communication? Synchronous IPC is what we usually refer to as a Remote Procedure Call (RPC), examples being a call to a dll function or an MTS object, or executing a SQL query. 23/05/2019 Message Queuing - a walk on the wild side

Okay, what then is Asynchronous Inter Process Communication? Asynchronous IPC means that the process requesting the service doesn’t wait for confirmation that the service has been carried out. 23/05/2019 Message Queuing - a walk on the wild side

Why would I want to use this malarky when I can use good old RPC’s? Lots of reasons, but mainly: Your calling process wants to get on with things and doesn’t care when the service is carried out, as long as it’s assured that it will be eventually, guaranteed, no questions, no excuses. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Like when?? Example: an order processing system When a customer places an order, the Order Placing component doesn’t want to wait for the Credit Check, Stock Control and Order Despatch components to deal with the order. MQ is one way to accomplish this, in a way which allows parts of an application to continue functioning even if other parts are out of service. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side How does it work? One process acts as a client and posts a message to a named queue. The other process acts as a server and retrieves the message from the named queue and processes it. The message contains everything it needs to perform the required service. The Message Queue system takes care of everything in between 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side If required, notification of completion of the service could be posted back to the client as another message in a separate queue 23/05/2019 Message Queuing - a walk on the wild side

What exactly is a “message”? A message is a container for whatever you like. It can contain some ASCII text, or a large chunk of binary data to be stored in a database, a spreadsheet, or anything in between. The MQ system doesn’t care about the contents, or impose any formats. Both processes (ie the programmers) must have agreed beforehand on the format of the message body – no XML-type dtd’s, WSDL or any of that stuff.) 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Typically there will be a single queue for each IPC, ie between each client and the server providing the service. A ‘componentised’ application could, overall, use many queues. Queues are managed by the MQ Service. The MQ Service guarantees that the messages are persisted, delivered once only, and retrieved in FIFO order.   Messages can be grouped as a transaction (so that they are all successfully processed, or none are.) 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side This demo uses MSMQ2, which is part of Windows2000+, but there are other cross-platform MQ systems available. It’s called MSMQ2 because it’s the first version that works properly. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side What’s it look like? Single server model (ie single-machine model) Multi-server model 23/05/2019 Message Queuing - a walk on the wild side

Single server model (ie single-machine model) Simple to setup and administer Has the advantages of AIPC without much complexity BUT Is limited to processes running on the same machine. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Multi-server model More complex to setup.   Can be across the motherboard, across the room or Across The Universe. (over MSII – the Microsoft Intergalactic Internet – real soon now) Can provide multiple routes for messages, and is therefore very robust. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Has lots of TLA’s (MQIS, PEC, BSC, PSC, RS, IC, DC and the list goes on…. it’s TLA Heaven. eg “a BSC may also be a RS, but you must install a PEC or PSC before you install a BSC, whether you use an IC or a DC…”)   These all work together to guarantee that a message is delivered once, and once only, wherever it is sent. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side A Primary Enterprise Controller (PEC) manages the entire MQ system across servers. It is the foundation of the MQ infrastructure. The Primary Site Controller (PSC) is the No. 2IC, controlling one site in the infrastructure. The PEC also serves as the PSC for its own site. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side A Backup Server Controller (BSC) provides load balancing and failure recovery support. It takes over control if the PEC or PSC fail. The Routing Server (RS) supports dynamic routing, load balancing and intermediate store-and-forward message processing. RS’s allow multiple routes to be set up between source to destination, with cost-based routing policies. PEC, PSC and BSC all act as RS’s. 23/05/2019 Message Queuing - a walk on the wild side

Either way, to process the messages you can use….  Sequential server:   The server process waits for a message to arrive at the top of the named queue. It pops the message off the queue and processes it. This is repeated, one message at a time. Each message has to wait for the previous message to be processed before it is dealt with. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Alternatively the process can respond to OnMessage (?) events, using separate threads to process each message. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side Message Queuing is complementary to binary remoting. 23/05/2019 Message Queuing - a walk on the wild side

Here’s One I Did Earlier: 23/05/2019 Message Queuing - a walk on the wild side

Now for some Code examples…. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side .Net provides classes that tidy up a lot of the detail (System.Messaging namespace) but not all – so I did my own to finish the job…   23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side MSMQ.cs: contains a class for opening a local queue for reading or writing, first creating it if necessary, and posting or retrieving messages to and from it. This class abstracts most of the details of using the message queue, including serializing the message object. MSMQSender and ProcCall code which posts messages to the queue using the above class. MSMQReceiver for an application client which pops messages from the queue, using the above class. ProcCallHandler a processing server, which retrieves procedure call messages from the queue in sequence and executes the requested procedure. A sort of disconnected RPC processor. 23/05/2019 Message Queuing - a walk on the wild side

Message Queuing - a walk on the wild side References: MSMQ from Scratch (Crane, Crummer, Miller) Visual Studio.Net Help MSDN 23/05/2019 Message Queuing - a walk on the wild side