Overview Describe the concepts and some practical applications of messaging. Describe the concepts and basic structure of JMS. Write simple JMS messaging code using the publish and subscribe and point-to-point domains. Discuss advanced JMS issues such as guaranteed messaging, transactions, reliability, and recovery.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Overview
Describe the concepts and some practical applications of messaging.Describe the concepts and basic structure of JMS.Write simple JMS messaging code using the publish and subscribe and point-to-point domains.Discuss advanced JMS issues such as guaranteed messaging, transactions, reliability, and recovery.
Part 1: Enterprise Messaging and JMS
Enterprise messaging
Message-Oriented
Middleware
Application A
Messaging API
Messaging Clients
Application B
Messaging API
Messaging Clients
Tightly Coupled RPC
BusinessApplication A
RPCClient/Server
BusinessApplication D
RPCClient/Server
BusinessApplication B
RPCClient/Server
BusinessApplication C
RPCClient/Server
Requires n * (n-1) / 2 connections
JMS messaging
JMS Client
Message Server
JMS Client
JMS Client
JMS Client
JMS Client
JMS Client
JMS Client
Local "server"
JMS Client
Local "server"
JMS Client
Local "server"
JMS Client
Application A
Local "server"
Application B Application C Application D
Router
Decentralized message server (IP multicast)
Centralized message server(hub and spoke)
The J2EE platform
Client Application
JMS Server
EJB Container
Web Container
Application Client
Container
JDBC Database
J2EE Platform
Part 2: JMS Concepts and Coding
Wholesaler and retailer
Message ServerWholesaler
Retailer 1
Retailer 2
Update price(publish)
Order product(send)
JMS features
Standard Java APIMessage delivery modesTwo messaging modelsTransactionsReliability levelsPersistent messaging
JMS messaging domains
Publish and subscribeMany consumers per message
Point-to-pointOne consumer per message
Publish and subscribe: Supply chain management
PublisherPublisher SubscriberSubscriberTopicTopic
Point-to-point: Order and fulfillment
Goods ShippedGoods Shipped
Queue
Need SuppliesNeed Supplies
Sender Receiver
JMS components
Message Server
Message MessageDestination
JMS Client
Connection
Session
Producer
JMS Client
Connection
Session
Consumer
Connections and sessions
A connection connects to a message server.
You can create one or more sessions within a connection.
JMS Client
Connection
Session
Session
Session
Creating connections and sessions
Message Server
JNDI Store
JMS Client
Connection
Session
Session
Session
ConnectionFactory
create
ConnectionFactoriesDestinations
JMS message types
A stream of uninterpreted bytesBytesMessage
A stream of Java primitivesStreamMessage
A set of name/value pairs where values are Java primitivesMapMessage