1
<Insert Picture Here>
JMS + Web Services w/ JAX and Spring
Jeffrey West, Pyounguk Cho, Dave CabelusWebLogic Product Management
3
<Insert Picture Here>
Program Agenda
Web Services• WebLogic Web Services Overview• Spring WS Build (Code walkthrough, Demo)• Spring WS Limitations• JAX-WS Build (Code walkthrough, Demo)• JAX-WS Benefits
JMS• WebLogic JMS Overview and New Features• Spring MDP Build (Code Walkthrough, demo)• Spring MDP Limitations vs. MDB Benefits• Java MDB Build (Code Walkthrough)
4
WebLogic Web Service Overview
Interoperability
Standards Extensions
• World-class implementations• JAX-*
• WS-*
• Value-added extensions
• Reliability
• Scalability
• Performance
• Interoperability assurance
• Oracle FMW products
• 3rd-party stacks
WLS WS
5
• JAX-*
• SOAP1.* & WS-Policy
• WS-SecurityPolicy
• WS-ReliableMessaging
• WS-Addressing
• WS-SecureConversation
• MTOM
• WS-AT
• REST
• JAXB/SDO databinding
• WS-I BP/BSP/RSP
• SCA Spring C&I
Standards
Features Overview
• RASP
• Database web service
• JMS transport
• Pluggable databinding
• Asynchronous web service
• Stateful web service with C*Web
• Conversational web service
• Custom policies
• Interoperability
Value-added• Web service management
• Web service security configuration
• Policy attachment
• Policy management
• WLST-based web service management
• Test page
• Performance monitoring
Management
6
Enterprise Web Services Infrastructure
Oracle Web Service
StatefulServiceJAX-WS JAXB
Data BindingSDO AsynchService
WS-Security
WS-Addressing
WS-Reliable
MessagingMTOM Logging
AuditingWS-AT
Web Services Java Programming Model – Java EE
Declarative QoS (WS-Policy)
SCA
Binary payload
Enterprise Web Service Design Patterns
Content-basedRouting Access Control Data Protection Composition
GuaranteedDelivery
Long runningServices
ConversationalServices
Service Virtualization
AsynchronousMessaging
7
Interoperability Assurance
• Heterogeneous Web Service Platforms common in Oracle customers’ environments
• Interoperability assurance efforts• WS-I Profile support : BP/BSP/RSP• WSTF• Vendor-sponsored interop-events• Service invocation testing tools• Runtime relaxation options• Hosted Interoperability testing environment(WSIP)
• Click-&-Test for services and clients• Major 3rd-party SOAP stacks• WS-* compositions
8
JAX-WS Programming Model
Protocol (SOAP/REST)
Server SideRuntime System
JAX-WS API
Client sideRuntime System
Stub
Service Endpoint
WSDL
WSDL<->Java Mapping
Dispatch
Container
Service Client
Transport
Tie
JAX-WS API
9
JAX-WS Development Tools
• WLS web service Ant commands• JAX-WS
• JDeveloper• JAX-WS & SOA• Iterative development• WSDL editor• HTTP Analyzer
• HTTPS• WS-*
• DBWS• JAX-RS• WLS SCA
• OEPE• JAX-WS• WSDL editor• JAX-WS/JAXB custom binding file editor• WLS SCA
10
Spring Web Services
• Philosophy• Document-driven• Contract-first• Fragility• Performance• Reusability• Versioning• Loose coupling between contract and implementation• Less rigid schema conformance (Xpath)
• Built on Spring framework• Inherit key Spring concepts• POJO-centric• Dependency injection (IoC)• Application context • Bean Factory• Architecture similar to Spring MVC• Configuration using Spring Application Context
11
Key Features
• Powerful mappings• XML API support
• JAXP(DOM/SAX/StAX), JDOM, XOM• Xpath(to bypass databinding)
• Flexible XML marshalling• JAXB 1.0/2.0, Castor, XMLBeans, JiBX, XStream
• Multiple transports• WS-Security
• Acegi security for authn/authz
• Message logging & tracing• Integration points with other web service frameworks
such as JAX-WS
12
Key Features(Service)
• Endpoint• Two programming models• Inheritance(xxxEndpoint)• Annotations(@Endpoint, @PayloadRoot, @XPathParam…)• Marshalling types• XML-centric• POJO-based
• EndpointMapping• Message routing rules• URL• SOAPAction• Method• EndpointIntercepter• Logging• Validation• Transformation• Security
13
Key Features(Client)
• WebServiceTemplate• Analogous to Spring JdbcTemplate• XML-centric invocation• POJO-based invocation
• WebServiceMessageCallback : client side JAX-RPC/WS handlers
• When using (un)marshalling• To set SOAP headers• To set transport-level properties
• Multiple transports• HTTP, JMS, SMTP
• QoS for HTTP• When using jakarta Commons HttpClient• HTTP basic auth• HTTP connection pooling
14
WebLogic JMS Overview
• Full-featured, high-performance, production-grade messaging engine built-in:– Nothing else to install or
manage– Shared tools, security– Performance benefits – no need
for network hops, serialization/deserialization
• Full set of HA capabilities, unique ordering features
• OEPE has a JMS module editor to make configuration easy
1 4 8 16 32 640
5000
10000
15000
20000
25000
30000
35000
Persistent Queues – 100 Byte Msgs
WebLogic JMS WebSphere MQ
Producers/ConsumersM
es
sa
ge
s p
er
Se
co
nd
15
JMS Event-Driven SOA EnhancementsWebLogic 10.3.4 – Partitioned Distributed Topics, Shared Subscriptions, APIs, MDB Enhancements
• Enables architectural flexibility
– Scale the messaging infrastructure to adapt to growing traffic needs
– Send/pub side has no knowledge/dependency on the receive/subscribe side
• Messages load balanced, not duplicated
• MDB enhancements to handle subscriptions
– Subscribe to the Distributed Topic, not the individual member
• Improved performance and scalability
• Aligned MDB and Topic clustered deployment
32
Messages published to Distributed Topic load-balanced among members
1
Cluster
Server 1 Server 2 Server 3
DT Member 1
DT Member 2
DT Member 3
Distributed Topic
MDB MDB MDB
Subscription SubscriptionSubscription
16
JMS Event-Driven SOA EnhancementsWebLogic 10.3.4 – Partitioned Distributed TopicsRemote Cluster Case
Cluster 1
Cluster 2
Server 1
DT Member 1
DT Member 2
DT Member 3
1 2 3
Publish
MDB
Shared Sub Shared Sub Shared Sub
Distributed Topic
15
9
Server 2 Server 3
MDB MDB
4 5 67 8 9
24
6
37
8
• Parallelism for performance and scalability
• Architectural flexibility– Adaptability– No dependency on
architecture from either publish or subscribe side
• Simplified configuration
17
Limitations of MDPs
• Primary concern – MDPs are not cluster-aware– No support for automatic subscription handling– No support for HA/migration– No real automatic handling of cluster topology changes, esp remote
• Other limitations:– Security model differences– Foreign TX management limitations– No automatic resource pooling
• Distributed topic subscription work-around: – Use foreign JMS to map a common local JNDI name to the DT
member name– Additional benefits: automatic resource pooling
18
MDB Benefits
• Easier to write – use annotations instead of descriptors and resource wiring through beans in applicationContext.xml
• Container handles the details:– MDB manager created wherever destination resides– Simplified subscription handling – container creates
necessary subscriptions– Adapts to cluster topology changes
• Shared security model, common transaction manager, automatic resource pooling
19
• @MessageDriven(• messageListenerInterface = javax.jms.MessageListener.class,• name = "UpdateParcelStatusMDB",• mappedName = Constants.EVENT_TOPIC_JNDI,• activationConfig = {• @ActivationConfigProperty(• propertyName = "connectionFactoryJndiName",• propertyValue = Constants.CONNECTION_FACTORY_JNDI),• @ActivationConfigProperty(• propertyName = "destinationType",• propertyValue = "javax.jms.Topic"),• @ActivationConfigProperty(• propertyName = "subscriptionDurability",• propertyValue = "Durable"),• @ActivationConfigProperty(• propertyName = "topicMessagesDistributionMode",• propertyValue = "One-Copy-Per-Application"),• @ActivationConfigProperty(• propertyName = "distributedDestinationConnection",• propertyValue = "LocalOnly")• })
<Insert Picture Here>
JMS + Web Services w/ JAX and Spring
Jeffrey West, Pyounguk Cho, Dave CabelusWebLogic Product Management
21
22
Section Divider