Effective Application Development with WebSphere Message Broker

43
© 2012 IBM Corporation Ant Phillips [email protected] Effective Application Development WebSphere Message Broker

description

 

Transcript of Effective Application Development with WebSphere Message Broker

Page 1: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Ant Phillips [email protected]

Effective Application DevelopmentWebSphere Message Broker

Page 2: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation2

Effective Application Development

▪What should you consider when building connectivity solutions?▪What technology is provided in Message Broker to help you?▪ This session aims to point you in the right direction!

▪Ant’s top tips will be highlighted as we move along!

▪We will consider development from several design perspectives:oUser-defined nodeso SubflowsoDeployable subflowso Librarieso Applicationso Serviceso PatternsoMobileo Pattern authoringoMessage Broker API

▪This session covers many new features such as service creation

Page 3: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application Development Introduction

Page 4: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Tools of the Trade!

4

Page 5: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Create Your Connectivity Solution

5

Built-in nodes encapsulate transports, technologies and applications– Our intent is always to make the common tasks easy, and the rest possible!– Use the built-in nodes to reduce the amount of custom code required– This makes best use of the built-in facilities like activity trace and resource statistics

Page 6: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

▪Message Broker has several transformation options:▪Mapping▪ XSLT▪ ESQL▪ Java▪ PHP▪ .NET

▪Reflects the importance of transformation in connectivity solutions▪User-defined nodes supported for Java and C/C++

▪Every transformation option has strengths and weaknesses!– Performance and scalability– Backend integration– Skill sets and learning curve– Developer usability– Portability and maintenance

Use a transformation technology appropriate to the problem at hand!

6

Transformation Options

Page 7: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Message Modelling

Models are needed for parsing, validation and transformation– Models avoid the need to write custom code to parse messages!

7

Graphical mapper requires models to display the message structure– ESQL editor provides in line validation of code that navigates message trees

Page 8: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Message ModellingDFDL and XML Schemas

8

XML documents and messages are modelled using XML schemas– XSDs and WSDLs are deployed directly to the runtime – no import required!

Non XML data (both text and binary) is defined using DFDL schemas– Data Format Description Language standardised through the Open Grid Forum– DFDL schemas replace message set projects and the MRM message domain – Message Broker input nodes now support DFDL alongside XMLNSC, JSON, MRM etc

New model based tooling to design and test DFDL schema models– Test parsing, test data generation and parse-by-example all built into editor!– As with XSDs, DFDL schemas are also deployed directly to the runtime

Page 9: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Design for Performance

9

There are several areas that incur a processing cost in Message Broker– Parsing and serialization of messages as they enter and exit Message Broker– Business logic such as transformations executed during message processing– Transformation cost includes general complexity, tree navigation and tree copying– External resources such as interactions with databases and queue managers

Message flow design is critical to achieve high performance and scalability– For example using global units of work to achieve transactionality across a flow

Performance is a large (and important) topic in its own right– There is a wealth of information and guidance available online!

Page 10: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation10

Design for Administration

▪Message Broker Explorer has a wealth of monitoring tools!▪ Statistics monitor resource usage across execution groups▪Range of options to update and visualise the resource statistics

Page 11: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation11

Design for Administration

▪Monitoring also provided on individual message flows▪Quick and easy way to identify hot spots in your solutions!

Page 12: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation12

Design for Administration

▪Use configurable services to externalize deployment time properties▪ Allows deployment information to be configured by a system administrator▪ For example, credentials for the database nodes and FTP server and port▪ Ideal for moving solutions through staging environments (test to production)

Page 13: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application Development Connecting with Nodes

Page 14: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation14

Connecting with Nodes

▪Nodes represent both logical end points and processing functions▪User-defined nodes can be written in Java, C/C++ and also as subflows▪Where possible use the built-in nodes - log a requirement if something is missing!

▪Several broad categories of node exist in Message Broker▪ Input, output, get and request nodes that manage end points▪ Asynchronous variations also exist for more efficient processing

▪ The JavaCompute node dramatically reduced the need to write custom nodes:

Page 15: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentSubflows

Page 16: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

▪Subflows are simply message flows that are invoked from another flow▪ Input and output nodes in the subflow become terminals in the main flow▪Use subflows to break up large problems into smaller more manageable chunks

▪Subflows are directly deployable to the Message Broker runtime▪ Shared subflows deployed just once per execution group (or application)▪No need to redeploy message flows after changes to shared routines are made▪Redeployment of a subflow is automatically picked up by any consumers

16

Subflows

Page 17: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentApplications and Libraries

Page 18: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation18

Applications and Libraries

▪Applications package end-to-end connectivity solutions▪ The concept of an application is shared between the toolkit and runtime▪ Applications are deployed and managed as a single unit of isolation

▪Libraries package resources for reuse (flows, scripts, models)▪Resources in an application are not visible to anything else

▪Use applications to manage your solutions inside an execution group

New in V8

Page 19: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentServices

Page 20: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation20

Services

▪Services are applications with a well defined interface (contract)▪ The service interface is expressed with a WSDL and a port type▪ Service creation includes tooling to build the interface and structure▪ Each operation is implemented as a (deployable) subflow ▪ Service descriptor (XML) ties the interface with the service implementation

▪Services are deployed and managed just like regular applications▪ Supporting resources are deployed with the service (maps, ESQL, schemas)

Page 21: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentPatterns

Page 22: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation22

The Challenge

From:MQ

File

WSDL

To:

Page 23: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation23

Patterns for Simplified Development

Creates top-down, parameterized connectivity solutions

Reduces common problems in flow development

Establishes best practices for healthcare integration

Reduces time-to-value for solution development

Patterns are easily extended with regular broker functionality

Page 24: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Built-In Patterns

Message Broker provides a core set of built-in patterns

These implement a variety of common scenarios– Web service front end to a MQ based application– Processing data stored in a file and routing to one or more queues– Adding a proxy in front of a web service provider– Processing data from an SAP system and routing to MQ– Shredding messages and routing to one or more queues

Patterns are selected based on client feedback and field experience

This core set of patterns continues to grow with each release

24

Page 25: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentMobile

Page 26: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Worklight integration makes developing mobile services simple!– Four new patterns makes mobile service integration quick and easy– Toolkit support to mobile enable Message Broker services– Pattern source included for flexible customization to many other tools

Message Broker mobile patterns– Mobile enablement for Microsoft .NET applications– Create flexible mobile services on top of Message Broker– Resource management including security and caching– Outbound push notifications for asynchronous data delivery

26

Mobile

Page 27: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation27

Mobile Enablement for Microsoft .NET Applications

Creates a mobile-ready service around a Microsoft .NET application– Generates a web service implementation which is deployed to Message Broker– Builds a Worklight integration adapter and a sample mobile application– Inbound data from the mobile application is sent to Worklight as JSON/HTTP– The adapter converts the JSON data into/from SOAP/HTTP for the .NET web service

Page 28: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation28

Mobiles Services

Creates a mobile-ready interface around a Message Broker service– Right click option on a Message Broker service to mobile service enable it!– Builds an adapter to integrate Worklight and Message Broker services– Inbound data from the mobile application is sent to Worklight as JSON/HTTP

Makes it very simple to mobile enable a Message Broker service!– The adapter passes the inbound request straight through to the service– Pattern adds an HTTP/JSON message flow (binding) to the service project

Page 29: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Asynchronous Push Notifications

29

Creates a push notification adapter from a WebSphere MQ queue– Generates a web service implementation which is deployed to Message Broker– Users receive notifications when the mobile application is not active– Efficiency gain as application does not need to issue constant queries– Saves battery life and also reduces network bandwidth (communication fees)

Push notifications are applicable across many industry verticals– Notifications are not always appropriate and do have disadvantages

Page 30: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Worklight Resource Handler

30

Resource oriented architecture is a well known implementation pattern– Provides a common set of functions (CRUD – Create Read Update and Delete)– A Message Broker service is generated with subflows for each operation– The service integrates security authorization and authentication (LDAP)– Operations optionally integrate with the Message Broker Global Cache (WXS)

Page 31: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentPattern Authoring

Page 32: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation32

Pattern Authoring

Patterns becomes even more compelling when you can create your own!– Every organization has their own repeating connectivity patterns!– Pattern authoring is the name we give to this technology in Message Broker

We recommend you start with a working solution– One or more Message Broker projects

Pattern authoring is a design activity– It may be long lived– It is often not sequential

Using patterns is a top-down activity driven by a requirement, but:– Authoring a working solution is (typically) a bottom-up activity– So pattern authoring bridges these two different approaches

Patterns have their own development cycle– Pattern Authoring editor supports this design activity

Page 33: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Create Your Working Solution

33

No change at all - design your Message Broker solution as you do today– Pattern authoring does not change the tools you use to create solutions– The key to a good pattern is to create a good working solution!

Page 34: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Design Your Pattern

34

Straightforward to create patterns using the Pattern Authoring editor!– Design the user interface which is presented to your pattern users– Easy to add branding - style sheets, images and other files as required

Page 35: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Pattern Refinement

Pattern authoring in Message Broker supports property changes– Node, user-defined properties (UDPs) and promoted node properties

Property variability is the most common type of variability that a pattern might need to express - there are many others:

– Generate application text files such as ESQL scripts– Make structural changes to Message Flows– Create administration files such as MQSC scripts

It is impossible to try and predict all the possible extensions that a pattern author might wish to implement

In Message Broker we provide two ways to extend pattern authoring– Java code that is invoked when pattern instances are generated– PHP templates that generate text files in pattern instance projects

35

Page 36: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Packaging a Pattern

36

Page 37: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation37

Effective Application DevelopmentFrom small to large!

User-defined nodes (UDNs)

Opaque node implementation hides intellectual propertyExtend the built-in nodes with your own business logicExcellent potential re-use across many applications

Subflows A piece of reusable logic implemented as a subflowCopy-and-pasted into the main flow by the BAR compiler

Deployable subflows Separately deployed from the main flows that invoke them

Libraries Packaging mechanism to facilitate reuse of many resourcesShared understanding between the toolkit and runtime

Applications Connectivity solutions which are managed as a wholeTypically combines one or more libraries together

Services Services provide interface (contract) and implementationPromotes encapsulation, isolation and re-use of solutions

Patterns Re-use working solutions quickly and easilyCreates production ready connectivity solutionsBuilds on all of the above technologies!

Page 38: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Message Broker APIMigration, Mash-ups, On-demand Applications…

Page 39: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation39

Message Broker Flow API

The Message Broker Flow API is our Java application development API– Packaged along with the administration API in ConfigManagerProxy.jar– Provides a complete Java API to manipulate message flows (and subflows)

The Message Broker Flow API can be used in standalone applications– Wide variety of applications are now possible such as business data mashups– Easy to implement mass creation of message flows during migration projects

Page 40: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Effective Application DevelopmentDebug and Test

Page 41: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Debugging Applications

Message Broker has excellent real time debugging facilities built-in:

41

Page 42: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Unit Test Client

42

Page 43: Effective Application Development with WebSphere Message Broker

© 2012 IBM Corporation

Use the features of Message Broker to their full extent!– Message modelling, transformation options, applications and libraries– Capabilities link in with activity trace, record edit replay, and more

Libraries and subflows make for simpler designs– Deployable subflows and libraries extend the benefits to the runtime

Consider production and performance early on in your design– In particular, applications and configurable services– Your system administrator will thank you for this!

Patterns address time-to-value for your solutions– It takes just a few minutes to create a pattern!– Why not create a patterns community in your organisation?

Tell us what you need in Message Broker – we really do listen

43

Effective Application DevelopmentSummary