You are on page 1of 49

IBM WebSphere Technical Conference 2011

October 10-14, 2011 Berlin, Germany

M19 WebSphere ESB Best Practices and Performance Recommendations

Callum Jackson | WebSphere ESB Runtime Architect | IBM

IBM Corporation 2011 IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Agenda
Brief Product Recap Best Practices

Planning, Design and Architecture Process Development Performance References and Further Information

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

WebSphere ESB Essentials: Family Values...

IBM Business Process Manager Advanced Edition

Choreography And Solution Viewpoint

WebSphere ESB WebSphere Application Server ND WebSphere Application Server

Mediation

Clustering

App Server

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Service Component Architecture


SCA Module

I
Request / Reply

Export

I R R

SCA Component

I
One-way

SCA Component

Request / Reply

Export

Import

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Module and Component Types


WebSphere ESB supports only Mediation Modules, with these components:

Mediation Flows Java


IBM BPM Advanced Edition also supports (Integration) Modules, with these additional components:

BPEL (Process) Human Task Rule Group (Business Rules) etc

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Connectivity Support
Supported Connectivity Bindings and Adapters for import and export nodes
Web Services (SOAP/HTTP, SOAP/JMS) Messaging (JMS, MQ, JMS MQ, generic JMS (3rd party providers)) J2EE Applications (EJB binding) Native (SCA cross module) HTTP Access (JSON, XML) IBM CICS ECI Resource Adapter IBM IMS Connector for Java IBM WebSphere Adapter for Email IBM WebSphere Adapter for FTP IBM WebSphere Adapter for Flat Files IBM WebSphere Adapter for JDBC IBM WebSphere Adapter for Lotus Domino IBM WebSphere Adapter for Enterprise Content Management IBM WebSphere Adapter for JD Edwards EnterpriseOne * IBM WebSphere Adapter for Oracle E-Business Suite * IBM WebSphere Adapter for PeopleSoft * IBM WebSphere Adapter for SAP Software * IBM WebSphere Adapter for Siebel Business Applications * 6

* runtime license required

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Best Practices: Planning, Design and Architecture


Brief Product Recap Best Practices

Planning, Design and Architecture Process Development Performance Summary References and Further Information

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Use the Right Type of Module (1/2)


Design consideration mediation logic vs. process logic Use Mediation Modules (WebSphere ESB & BPM Advanced) for Mediation Flows integration / mediation logic:
Short-running, minimal choreography (augment,aggregate) Supports header manipulation

Use (Integration) Modules (BPM Advanced only) for BPEL business / process logic:
Can be long-running, provides powerful choreography

More Information:
http://www.ibm.com/developerworks/websphere/library/techarticles/0803_fas binder2/0803_fasbinder2.html
IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Use the Right Type of Module (2/2)


As of V6.2, mediation flow components can be used in (Integration) Modules Can be necessary in some cases to mix mediation and business logic in same module e.g. performance In some limited cases, can also make sense to treat BPEL as a visual programming language for complex integration However, be careful to keep the line between mediation and process logic clear in your design

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Exploit supplied Integration Patterns


Where possible exploit the supplied integration patterns
Accelerate mediation development Generated modules follow best practices

Currently available integration patterns:


Static simple service proxy Dynamic simple service proxy Static service gateway Dynamic service gateway Proxy service gateway Service translator (Feature Pack) Service selector (Feature Pack)

10

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Understand Invocation Styles


Default invocation style typically dictated by bindings often OK but be aware of it Async interactions (between components or modules) go via an SCA/JMS/MQ queue which implies:
Break in transactional scope Runtime exception causes rollback which after retry limit results in message going to exception destination then handled via Failed Event Manager

Can be hard to predict when interactions will be async subtleties in performance optimisation etc. Assume async if in doubt, and use preferredInteractionStyle liberally More details:
http://www.ibm.com/developerworks/websphere/library/techarticles/0811_cha cko/0811_chacko.html

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Understand Invocation Styles An example of unintended asynchrony


Preferred Interaction Style = Any
Async exports like JMS, MQ, and SCA Async, set interaction style to async

Mediation flow component propagates callers interaction style if callees PI style is Any

Unintended asynchronous calls

12

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Design Transactions Important to design transactions


Affects what happens when errors occur Integration Designer defaults are only a starting point If you are interacting with JDBC or a messaging system probably want transactionality

Guiding principles
Every transaction commit adds overhead Minimize transaction commits to implement desired transactional behavior Pay particular attention to SCA transaction qualifiers

13

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Design Transactions - SCA Qualifiers Ensure transactions propagate across components until the desired commit point To achieve this, follow the Golden Path
suspendTransaction = False Transaction = Any or Global joinTransaction = True
joinTransaction = True

Transaction = Any

Transaction = Any suspendTransaction = False

14

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Design Transactions - SCA Qualifiers


Use the Transaction Highlighting and Qualifiers editor More information: http://soatipsntricks.wordpress.com/2008/07/31/transactionality-in-sca-part-2refactoring-interfaces/

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Select your Default Binding Carefully


Often the binding type is dictated by circumstances But if you have the scope to decide:
Prefer SCA default/native for intra/inter-ESB communications fast, efficient, and simple Prefer Web Services (JAX-WS) for synchronous service exposure mature, integrates well into SDO model Prefer JMS for asynchronous service exposure integrates well with Application Server platform

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Consider How you Split up Modules


How much content inside each module?
Large number of modules impacts memory consumption / deployment / failover Small number impacts ease of development in general, best not to have more than one developer per module Default is share by copy for libraries may result in large memory usage

Module A Module B Library C build

Module A Library C Application A

Module B Library C Application B

Consider share by reference implications on module versioning http://www-01.ibm.com/support/docview.wss?rs=2307&uid=swg21322617

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Spend Time on Interfaces and Business Objects


Refactoring support doesnt allow you to arbitrarily change a design, so get as right as possible upfront Especially important for versioned long-running processes and for new live process migration in v7 Adopt a naming convention Add constraints? Add modelled faults? Use namespaces define an enterprise policy Configure default namespace policy before you start

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Use mediation policies to control points of variability


Mediation policies
Allow declarative control of mediation function by externalizing mediation points of variability

Benefits
Reduce mediation construction complexity Much more flexible mediation dynamic control

Supported by supplied capabilities


Dynamic context Policies authored via Business Space stored and governed in WSRR Policy Resolution mediation primitive

19

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Best Practices: Process Brief Product Recap Best Practices


Planning, Design and Architecture Process Development Performance

References and Further Information

20

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Consider your Logging Strategy


You will want one! Why logging - Diagnostics? Auditing? Monitoring? Options include:
Message Logger (Mediations) logs to classes implementing java.util.logging (as of v6.2) Trace Primitive (as of v7) not intended for production use JDBC or Flat File Adapter (in separate module?) Basic visual snippets for logging Custom primitives Cross-component Trace Facility Use subflows or separate module for common logging logic

Turn trace off when not needed

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Logging Best Practices Think about granularity


Logging on entry to services and calls to other services topping and tailing typically a good starting point

Include a unique identifier for each interaction Property promotion can be good to disable logging

22

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Use Source Control


Use source control Integration Designer/Eclipse integrates with several Only one developer per module at once lock appropriate files if possible
Dont try to merge module changes complex and error-prone

Dont keep too much checked out project sets can help here. Do not check in generated artifacts
<xxx>App, <xxx>EJB, and <xxx>Web projects, and anything marked in Eclipse as derived more information here: http://www.ibm.com/developerworks/websphere/library/techarticles/0604_beers/0604_b eers.html

In some rare circumstances, you need to make changes to generated files


Use ANT scripts to make those changes when needed, so they can be repeated

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Do Repeatable Unit Testing


As of version 6.1, WebSphere Integration Developer has support for unit testing (called component testing) IBM Integration Designer 7.5 adds the ability to generate a test case from an Integration Test client execution Use it before check-in. Can be run from command line as part of automation. Can be deployed to server and run from Web-based GUI. Make sure tests can be run by next developer check them in. Article with more information:
http://www.ibm.com/developerworks/websphere/library/techarticles/0806_gregory/0806_greg ory.html

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Best Practices: Development Brief Product Recap Best Practices


Planning, Design and Architecture Process Development Performance

References and Further Information

25

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Handle Faults Appropriately Two types of fault:


Modelled faults
Appear on the interface a.k.a business, checked faults Can have business or technical purposes

Unmodelled faults dont appear on an interface


a.k.a. system, runtime, or unchecked Should have only a technical purpose

Make provisions to handle both types


Handle unmodelled faults as close to the source as possible Handle modelled faults where appropriate

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Dont use (Technical) Headers for Business Data Includes SOAP Headers, MQ Headers, JMS Headers, etc. Intended for point-to-point interactions for communicating technical information (routing, QoS, etc.) Only supported by mediation flows best on boundaries Can require extra custom work, e.g. MQ Header Binding

27

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Keep Schemas and WSDLs Simple Avoid anonymous complex types Don't use empty/null namespaces Dont use the same namespace in two libraries/projects Use the gamut of XSD types: don't make everything an xsd:string

28

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Use the Range of Debugging Tools Available


Integration Test Client

Debugger
Supports Breakpoints, Step Over, Inspection of SDO/SMO, etc.

Cross-component trace integrated with the Server Log view Logging Generic Service Client (V7.5)

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Understand your Message Manipulation Choices in Mediation Flows


Message Element Setter Simple and high performance Cannot alter message type Parts of element map are directly promotable XSLT Prefer when you want to use XSLT functions or work with XSLT directly Better performance when dealing with untouched XML data generally when working with Web Services (but test relative performance!) BO Map If you want to share BO maps with WPS, use relationship service, or need/want ordering capabilities of the BO mapper:

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Promote Properties where Relevant


Link them with the same alias name, where relevant, so that they can be modified together

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Promote Properties where Relevant From V6.2, promoted properties are dynamic can be overridden by values set in SMO dynamic context Policy Resolution mediation primitive allows property values to be resolved from WSRR based on gate conditions from message content
Allows governance of property values Potentially reduces flow complexity

Not to be confused with policy on Web Service endpoints, for example to setup WS-Security with JAX-WS
IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Replace Older Custom Code with New Functionality UDDI Endpoint Lookup Primitive (7.0) Trace (7.0) / Enhanced Message Logger (6.2) for logging & tracing Message Validator (7.0) Flow Order Primitive (7.0) Type Casting in XSLT Map (7.0) and many others!

33

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Best Practices: Performance Brief Product Recap Best Practices


Planning, Design and Architecture Process Development Performance

References and Further Information

34

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Design and Use System Topology Early Reasons to cluster


High availability Scalability Better HW utilization Managability Performance is only one consideration

We recommend the Remote Messaging and Remote Support topology pattern


35
IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Design and Use System Topology Early


Make your development and test environments look like production (including security settings) Use the real database and other supporting systems as early as possible Need a load balancer / HTTP server / proxy server? What other systems are you connecting to and how will they ensure failover / scalability? Redbook that discusses production topologies: http://www.redbooks.ibm.com/redpieces/abstracts/sg247854.html

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Large Objects Handle with Care


Guiding principles
Large object capability much improved from v6.1 onward, due to IBM J9 JVM 64-bit support effectively removes heap size limits Still inefficient to flow large data that is never touched through the system

Best practices
When large payload is a batch, send as multiple smaller payloads When only a small portion of an input message is used by the workload, use a Claim Check pattern http://www.ibm.com/developerworks/websphere/library/techarticles/1006_kharlam ov/1006_kharlamov.html Exploit 64-bit when necessary Stay up-to-date performance increases from release to release From V7.0.0.3, consider using Business Object Lazy Parsing mode

37

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Business Object Lazy Parsing Mode New business object runtime optimized for XML processing and transformation Uses a data representation more closely coupled to XML Offers significant performance advantages for XMLoriented scenarios Available from WebSphere ESB 7.0.0.3 with interim fix XC70031 and WebSphere Integration Developer 7.0.0.3 Ifix001 Default for new projects in IBM Integration Designer

38

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Significant performance gains for large messages and complex flows


Relative performance of lazy parsing mode versus eager mode varies according to the usage scenario Performance benefit is greatest when:
Processing large XML documents, particularly when only partially accessed Using mediation flows that combine transformation and other primitives, particularly those that use XPath

For example, the following example banking flow (based on IFX schemas) performs up to 428% faster in lazy parsing mode
BO Mapper Message Element Setter Fan Out BO Mapper Service Invoke BO Mapper Fan In
Message Element Setter

Message Filter

Service Invoke

BO Mapper

Message Element Setter

Heap occupancy is also reduced with lazy parsing resulting in improved large message capability

39

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Configuring lazy parsing mode


Business Integration view context menu

Wizard for selecting parsing mode

40

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Exploit Deferred Parsing


Even when using eager parsing mode, some WebSphere ESB primitives can exploit an optimization which lowers XML processing costs in certain cases The benefit varies by primitive and its application as follows:
Category 1 (greatest benefit) Message Filter (/header as root) XSLT Primitive (/body as root) Endpoint Lookup without XPath user properties Event Emitter (CBE Header Only) Category 2 (medium benefit) Message Filter (/body as root) Category 3 (no benefit) All other primitives

41

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Exploit Deferred Parsing


Best Practices
Flows with only Category 1 primitives will perform best Where possible use protocol headers for decision making Include key information in SOAP, JMS, HTTP headers The sequence of primitives in a flow is important Place Category 1 primitives upstream of Category 2 Place Category 2 primitives upstream of Category 3 A Category 3 primitive precludes optimization of any downstream primitives All primitives have some invocation overhead, so minimizing the number of primitives used will also be helpful

42

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Message enrichment by service invocation

7.5 7.5
NEW NEW

Simplified development of scenario where service invocation is used to enrich message content Previously required three mediation primitives:
1) XSLT to save message body to context 2) Service invoke 3) XSLT to merge results with original message body

Explicit message enrichment mode added to Service Invoke mediation primitive

XPaths specified to define location of request parameter for service invocation and location to place response

43

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Aggregation Considerations
Only carry the required data within the Service Message Object, consider the following techniques were possible: Remove/Delete the body after the FanOut primitive Only map the minimal information within a map Don't map the shared context after the FanIn has generated the output message Consider if the Service Invoke Message Enrichment mode can be used Try to use BO Mappers as extensively as possible

44

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Mapping Technology Selection


If the functionality supported by the BOMapper mediation primitive is sufficient for the data transformations then runtime performance will be significantly improved by using the BOMapper mediation primitive in place of the XSL Transformation (XSLT) mediation primitive. The observed improvement in runtime performance is directly linked to the size of the message being processed. The XSLT mediation primitive does provide additional functionality not supported by the BOMapper mediation primitive, so there may be circumstances that this is not viable.

45

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

References
InfoCenter:
http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r0mx/index.jsp

Support Sites:
http://www-01.ibm.com/software/integration/wsesb/support/

developerWorks:
http://www.ibm.com/developerworks/websphere/zones/businessintegration/wesb.html

developerWorks Forum:
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1672

IBM Education Assistant:


http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp

WebSphere ESB Development Guide: http://www-01.ibm.com/software/integration/wsesb/library/ SOA Tips n Tricks Blog:


http://soatipsntricks.wordpress.com/

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Summary
Brief Product Recap Best Practices

Planning, Design and Architecture Process Development Performance References and Further Information

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Questions?

48

IBM Corporation 2011

IBM WebSphere Technical Conference 2011 - Berlin

Copyright Information
Copyright IBM Corporation 2011. All Rights Reserved. IBM, the IBM logo, ibm.com, AppScan, CICS, Cloudburst, Cognos, CPLEX, DataPower, DB2, FileNet, ILOG, IMS, InfoSphere, Lotus, Lotus Notes, Maximo, Quickr, Rational, Rational Team Concert, Sametime, Tivoli, WebSphere, and z/OS are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol ( or ), these symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other countries. A current list of IBM trademarks is available on the Web at Copyright and trademark information at ibm.com/legal/copytrade.shtml. Coremetrics is a trademark or registered trademark of Coremetrics, Inc., an IBM Company. SPSS is a trademark or registered trademark of SPSS, Inc. (or its affiliates), an IBM Company. Unica is a trademark or registered trademark of Unica Corporation, an IBM Company. Java and all Java-based trademarks and logos are trademarks of Oracle and/or its affiliates. Other company, product and service names may be trademarks or service marks of others. References in this publication to IBM products and services do not imply that IBM intends to make them available in all countries in which IBM operates.

49

IBM Corporation 2011

You might also like