Message Oriented Middleware(MOM)
An alternative to synchronous invocation programming (RPC) when direct connections between communicating entities are not always possible /needed Example: - Application for salesman - Emails
MOM - How?
Allows applications to communicate using messages stored in queues Application communicates by : - Putting messages in queues and - Getting messages from the queues Typically involves asynchronous calls between client and server applications Message queues provide temporary storage when the destination program is busy
MOM - Deployment
MOM Features
Communication without dedicated connections Clients and server can run at different times Non-Blocking, Highly scalable & Versatile mechanism It provides its own NOS services
MOM Very Versatile
Queues can be: Persistent : slow but recoverable Transient : faster but volatile Local or Remote Messages can either be copied or removed from queue Messages are taken off queue on FIFO basis or on priority base
Messaging queues are very versatile One-to-One One-to-Many Many-to-One Many-to-Many
MOM Model I
Point-to-Point model Each message has only one consumer Receiver acknowledges successful processing of message No timing dependencies between sender and receiver Queue stores message until It is read by consumer The message expires
MOM Model II
Publish/ Subscribe Model Interested parties can subscribe to topic Applications can post messages explicitly to specific topics Each message may have multiple receiver Full decoupling in space, time and flow
MOM Models
Subscription Based
Advertisement Based
MOM Properties
Asynchronous Interaction Client Server are loosely coupled Messages are queued Good for application interaction Support for reliable delivery service Keep queues in persistent storage Processing of messages by intermediate message server Filtering, transforming, logging and routing Networks of message servers Manipulate message Natural for database integration
Message Broker The heart of MOM
Transforms incoming messages to target format Very often acts as application gateway May provide subject based routing
Message Broker - Services
Filtering - Selection of messages from sending machine
Groups of messages received based on selective methods
Types of filtering Channel Based : subscribe/unsubscribe Content Based : query technique Subject Based : pattern matching Transaction Send or receive Success or failure
Transaction operations COMMIT( successful transmission) ROLLBACK (failure) Role of producer in transaction
On COMMIT message is stored in server
Role of consumer in transaction
On COMMIT message is sent to destination On ROLLBACK message is resent to destination On COOMIT message is removed from message server
Transformation Conversion of message format Based on receiver side Message types: Text Object stream Multimedia, etc
Guarantee of message delivery Sender send message - Fire and Forget Message broker take action on trust Delivered to receiver
MOM provides/properties
Message Transforming Rule Processing Intelligent routing Message warehousing and flow control Repository services Directory services Management APIs and adapters