Welcome Five Cool Use Cases for the Spring component of the
Transcript of Welcome Five Cool Use Cases for the Spring component of the
2012 © Trivadis
BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN
Welcome Five Cool Use Cases for the Spring component of the Oracle SOA Suite Guido Schmutz
UKOUG Conference 2012
3.12.2012
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Guido Schmutz
• Working for Trivadis for more than 15 years
• Oracle ACE Director for Fusion Middleware and SOA • Co-Author of different books • Consultant, Trainer Software Architect for Java, Oracle, SOA
and EDA • Member of Trivadis Architecture Board • Technology Manager @ Trivadis
• More than 20 years of software development experience
• Contact: [email protected] • Blog: http://guidoschmutz.wordpress.com • Twitter: gschmutz
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Different strategies for integrating Java in SOA Suite
Java Embedding in BPEL
Java Callout in Mediator/Oracle Service Bus
Custom BPEL/XPATH Functions
JAX-WS or JAX-RS Web Services (SOAP / REST services)
EJB Services
JMS Adapter/Transport and Message Driven Bean (MDB)
Custom JCA Adapter or Custom OSB Transport
Spring Component
“When Java meets SOA”: https://blogs.oracle.com/rammenon/entry/java_and_soa_suite
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
SOA Suite 11g Overview
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
Unified Runtime
BPMN
Policy Manager Optimized
binding
Human Workflow
(+AMX, AG, Orgn)
Business Rules
Oracle Service Bus
Common JCA-based connectivity infrastructure
Repository
EM console +BPMN Screens
BAM
B2B
Mediator
Workspace Process Portal (WC spaces)
MS Office
BPM Studio (with Business and IT views)
Shared BPMN Model
Business View
BPA BPMN 2.0, BPEL
Rich End User Interaction Web based customization
Process Composer
BPEL
Process Analytics
Proc Cubes
Spring
2012 © Trivadis
Spring Service Component
The Spring Framework is a lightweight container using “plain old Java objects” (POJOs)
WebLogic SCA enables the usage of the Spring Framework and to expose components as SCA services and references
SCA extends Spring framework capabilities
• Publish spring beans as SCA component services
• Provide references to Spring beans wired to services of other components
Following types of component integrations are supported
• Java components to WSDL components
• WSDL components to Java components
• Java components to Java components
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
The HelloWorldImpl POJO used inside a Spring component
Hello World
Five Cool Use Cases for the Spring component of the Oracle SOA Suite
Lessons learnt: Make sure to compile classes before wiring!
3.12.2012
2012 © Trivadis
<sca:service> Element
Declares a Spring bean that SCA exposes as a service
Takes the following attributes:
• Name § the name of the service (required)
• Type § The fully qualified Java type of the Java class to be exposed as an SCA service
(required)
• Target § The bean to be exposed as a service (required)
Five Cool Use Cases for the Spring component of the Oracle SOA Suite 3.12.2012
2012 © Trivadis
<sca:reference> Element
Declares a Spring bean representing an SCA service external to the Spring application context
Takes the following attributes:
• Name § The name of the reference (required)
• Type § The fully-qualified Java type of the interface or class representing the remote service
(required)
• Default § The target bean for the reference if none is specified (optional)
Five Cool Use Cases for the Spring component of the Oracle SOA Suite 3.12.2012
2012 © Trivadis
Using the Predefined Beans
The following spring beans are predefined in SOA Suite:
• headerHelperBean – for getting an setting header properties
• instanceHelperBean – for getting Instance ID of composite and component, name of the Spring service component
• loggerBean – for providing context-aware logging message
You can also define your own Spring beans globally => see use case 3
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases § Case 1 - Configuration
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 1 – Configuration: Within SOA Suite
Use Case: Need configuration properties which are changeable at runtime
Within a SCA Composite preferences can be declared
• Has to start with bpel.preference
Use ora:getPreference('greetingMessage')from within BPEL
Restriction: Only scalar values are supported! Can only be accessed from a BPEL component.
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 1 – Configuration: Within SOA Suite
Values can be changed through System MBean Browser in EM § oracle.soa.config > Server : soa_server1 > SCAComposite > your_project >
SCAComposite.SCAComponent > your bpel_process
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 1 – Configuration: using Spring and JMX
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 1 – Configuration: using Spring and JMX
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 1 – Configuration: using Spring and JMX
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases § Case 2 – Dynamic Routing
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 2 – Dynamic Routing: Using Spring bean for subscription
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 2 – Dynamic Routing: Using Spring bean for subscription
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 2 – Dynamic Routing: Using Spring bean for subscription
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 2a – Dynamic Routing: Using Spring bean for subscription
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 2a – Dynamic Routing: Using Spring bean for subscription
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases § Case 3 – NoSQL
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3 – NoSQL: What is NoSQL?
NoSQL is a new class of databases
They don‘t use the relational data model and thus don‘t use SQL
Tend to be designed to run on cluster
Schema-Less - Don‘t have a fixed schema, allowing to store any data in any record
Different types of NoSQL databases • Key/value • Column Family • Document • Graph
For more info, attend my other presentation: NoSQL Databases for Implementing Data Services – Should I Care? – Tuesday, 15:10 – 16:10 – Hall 10a
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3 – NoSQL: MongoDB Integration through Spring
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3 – NoSQL: MongoDB Integration through Spring
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3 – NoSQL: MongoDB Integration through Spring
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3a – NoSQL: MongoDB Logging Bean
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3a – NoSQL: MongoDB Logging Bean
Define bean in the global spring context (custom predefined bean) so that logging is globally available
1. Add the bean definition here § SOA_HOME/soa/modules/oracle.soa.ext_11.1.1/classes/ springse-extension-global-beans.xml
2. Add the corresponding classes in either the lib or classes directory
3. Run the ant script and restart server (more information in readme.txt)
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 3a – NoSQL: MongoDB Logging Bean
Usage of the custom bean in the global spring context
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases § Case 4 – Twitter
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
Please follow me on twitter to get the full experience J Twitter User: gschmutz
2012 © Trivadis
Send a Twitter message to @gschmutz with the hash tags #ukoug and #springtalk …… to get the link to the slides
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
@gschmutz Cool stuff dude! Pls send me the link to the slides! #ukoug #springtalk
@gschmutz #ukoug #springtalk please!
@gschmutz #ukoug #springtalk this is so wrong! Send me that electronic trash!
@gschmutz #ukoug #springtalk Oracle SOA Suite and Spring rocks!
@gschmutz #ukoug #springtalk this is really cool!
@gschmutz #ukoug #springtalk
2012 © Trivadis
Case 4 – Twitter: Send an Update Message
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 4 – Twitter: Send an Update Message
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 4 – Twitter: Send an Update Message
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 4a – Twitter: Process Mentioned Messages and send message with link to slides J
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases § Case 5 – …
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Case 5: so many more ideas …. And not enough time
• Invoking Spring Batch
• Invoking Hadoop Processing
• Groovy Script integration (i.e. XML ó JSON)
• Read/Write Excel
• Create PDF
• Submit to Evernote
• Message Enrichment (Mediator cannot do that)
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Agenda
1. Introduction
2. How does the Spring component work
3. The use cases
4. Summary
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
Summary
The Spring component is a nice way to extend the functionality of the SOA Suite and the other service engines
Use cases for it are endless ….
Only use the Spring component if no out-of-the-box feature in the SOA Suite exists
Make sure that you test the Java and Spring stuff externally first
Only Spring Framework 2.5 …
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
2012 © Trivadis
BASEL BERN LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN
THANK YOU. Trivadis
Guido Schmutz [email protected]
[email protected] www.trivadis.com
3.12.2012 Five Cool Use Cases for the Spring component of the Oracle SOA Suite
Where and When Should I Use the Oracle Service Bus Tuesday 4th December at 09:55 - 10:55 - Hall 8b NoSQL Databases for Implementing Data Services – Should I Care? Tuesday 4th December at 15:10 - 16:10 - Hall 10a