Enterprise Java Development@TOPIC@
Communication between applications that exchange messages
Message forms a single, encapsulated, unit of communication between applications
De-couples Producer and Consumer of the Message
Message-Oriented-Middleware (MOM)
category of application communication
uses asynchronous message passing versus synchronous request/reply
Advantages
Producer and Consumer operate independently
Messages can be persisted when consumer unavailable
Messages can be retrieved even after producer is unavailable
Qualities of service can be applied independent of clients
Resource utilization can be applied by messaging provide
Producer/Consumer communicate over a TCP/IP connection
Directly aware of state of link to the other end
Producer cannot send messages when Consumer unavailable
Consumer cannot receive messages when Producer unavailable
Separate messages must be sent to separate clients
Producer must be aware of what Consumer needs
Security and QoS must be implemented by entirely within clients
Good for realtime status networks
Producer/Consumer communicate over a Uni-cast IP
No concept of an end-to-end link
Producer issues messages whether Consumer available or not
MOM can add acknowledgment and queuing mechanisms
Consumer cannot receive messages when Producer unavailable
Producer only needs to send one message
Consumers able to control when they receive
Security and QoS must be implemented by entirely within clients
Good for high performance publish/subscribe networks
Producer/Consumer communicate to a separate broker
No concept of an end-to-end link
Producer issues messages whether Consumer available or not
application can add acknowledgment mechanisms
Consumer can receive messages when Producer unavailable
Producer only needs to send one message
Consumers able to control when they receive
Security and QoS can be implemented within broker (thin client)
Good for fully decoupling messaging complexity from clients
Clients unaware of physical topology
MOM Brokers link can
honor time-of-day bandwidth constraints
conserve bandwidth between sites by only sending what is needed
point of site-to-site firewall control
form alternate route routing
Producer
produces message
Destination
target of produced message
source of consumed message
hosted by messaging provider
Consumer
consumes message
Sender
a Producer
sends message to a Queue with specific target/intent
Queue
a Destination
delivers message to, at most, one receiver
Receiver
a Consumer
intended target of message
Publisher
a Producer
publishes message to Topic with no specific target/intent
Topic
a Destination
delivers message to all Subscribers
Subscriber
a Consumer
has registered interest in a Topic
durable subscription – lives beyond active client connection
non-durable subscription – only exists during client connection
Requestor
sends message to a destination appropriate to be available to a Replier
receives reply for request
Request Destination
can be Topic or Queue
Reply Destination
can be Topic or Queue (typically a Queue)
Replier
receives request message from destination
sends reply message to destination specified in request
Each interaction with Destination can be made part of an existing ACID transaction
Transaction #1
Requestor
begins some work
sends message to a destination appropriate to be available to a Replier
Transaction #2
Replier
receives request message from destination
performs work
sends reply message to destination specified in request
Transaction #3
Requestor
receives reply for request
completes work