Professional Documents
Culture Documents
07-WLS11gR1 Labs - Messaging
07-WLS11gR1 Labs - Messaging
Messaging Basics
Built-in Best-of-Breed Messaging (JMS) Engine
Years of hardening. Strong performance.
• Using WLS JMS eliminates the need to acquire and manage a 3rd
party Messaging product,
• reducing Infrastructure Costs
• Reducing licensing costs
• taking advantage of superior capabilities offered by this engine
Basics – Advantages of “Built-in”
• No additional installation: runs in same process space as WLS
• Integrated infrastructure
• Leverages core WLS protocols and services (RMI, thread pooling)
• WLS supplies Web Services, Servlets, and EJBs which work in concert with
JMS
• Integrated security
• Uses same user identities
• Leverages WLS role-based security model
• Integrated administration
• Unified administration console
• Unified configuration
• Robust, proven built-in transaction manager
Caller 3
Incoming Calls Rep - A
(Producer) queue
1
Rep - B
Caller 2
Oracle WebLogic Server Rep - C
(Producer)
Publish/Subscribe Topics
3 2 1
Publisher Distribution Subscriber
topic
3 2 1
Subscriber
3 2 1
Publisher Oracle WebLogic Server Subscriber
Oracle WebLogic Server JMS Features
WebLogic Server
A
JMS Server
JNDI tree Persistent
A1 > A storage
(file or DB)
B1 > B
JMS Server
B
Client 2 JMS
Typical JMS Messaging Process
ConnectionFactory lookup and get WLS
ConnectionFactory 1
2
Connection Create a
connection. JNDI
Destination: Queue
Create a
session. Look up a
Session destination. 3 Destination: Topic
JMS Server
Destination
Destination is returned. 4 To send messages,
these are required:
- Connection
Send - Session
Client message. 5
- Destination
Oracle WLS JMS Server
• In Oracle WLS, the messaging service is implemented through
a JMS server.
• A JMS server receives and distributes messages.
JMS client
Queues
Queues
Queues JMS client
Topics JMS
Topics
Topics Server A
JMS client JMS client
… Queues
Queues …
Queues
JMS client Topics JMS JMS client
Topics
Topics Server B
Persistence
JMS Modules
• JMS resources can be configured as:
• System modules
• application modules.
Domain
config.xml
deploy
«EAR»
«weblogic-
application.xml
DD»
«demo-jms.xml»
«MyJMSDescriptor-
jms.xml»
Topic A Associated
Publisher client
(A durable subscription) with
Persistent store
JMS server database or file
Messaging Manageability
Message Management
Distributed Queue A
JMS Server A
Distributed Server A
Producer
Queue A Consumer
Distributed Queue A
JMS Server B
Server B
Cluster A
Store and Forward (SAF)
Message sent to
imported
destination
• Store messages on local server 1
and forwards to remote server
when endpoint is available
• Increases reliability of
Message
communication forwarded to
• Forwarding between domains, 2 3
remote
destination
clusters, and servers
Message
• Preserves message ordering stored
locally
• Improvement over Messaging
Bridge
• SAF is faster and more scalable for
WLS-WLS connectivity
• Clusterable Message received
4
• Messaging Bridge still supported and by remote
consumer
useful for non-WLS connectivity or
pre-WLS 9.0 destinations
Messaging flow in SAF
Persistent 4
Store/Memory
Local SAF
sending agent
3
2 4
Remote JMS
Imported JMS Destination
Destination Connection
Connection Remote SAF Factory
Factory Context
1 5
Local JMS Producer Remote JMS Consumer
Remote
Local WebLogic
WebLogic
Server
Server
SAF Resources In a JMS Module
Enterprise Features
Interoperability: Mapping, Wrapping, & Bridges
• Problem Description 1 2 3 4 5 6 7 8 9
• Certain applications require strictly ordered
processing of messages
• Typically implemented by serializing processing
of ALL messages (kills performance) or adding
application complexity (detect or prevent out of
order processing) MDB 1 MDB 2 MDB 3
• Solution: Unit of Order
• How this feature works
• Messages tagged with same Unit of Order (UOO) State 2
are “processed” in order • MDB 1 completes processing message 1
• Next UOO Red message becomes available
• Applies across a cluster, too: messages routed to • Msg 3 consumed by MDB 3
DD member • Other UOO Red messages unavailable
• Concurrency through Multiple UOOs • …
• Stronger ordering semantics than the JMS
specification
3 4 5 6 7 8 9
• Benefits
• IT can support complex Business workflow
requirements without building major and costly
complexities into the apps or compromising
performance
• Reduces or eliminates DB lock contention MDB 1 MDB 2 MDB 3
Unit of Work
1
Producer
• Messages are grouped with a MDB
group identifier 2