Effective Application Development with WebSphere Message Broker
-
Upload
ant-phillips -
Category
Technology
-
view
3.794 -
download
6
description
Transcript of Effective Application Development with WebSphere Message Broker
© 2012 IBM Corporation
Ant Phillips [email protected]
Effective Application DevelopmentWebSphere 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
© 2012 IBM Corporation
Effective Application Development Introduction
© 2012 IBM Corporation
Tools of the Trade!
4
© 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
© 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
© 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
© 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
© 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!
© 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
© 2012 IBM Corporation11
Design for Administration
▪Monitoring also provided on individual message flows▪Quick and easy way to identify hot spots in your solutions!
© 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)
© 2012 IBM Corporation
Effective Application Development Connecting with Nodes
© 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:
© 2012 IBM Corporation
Effective Application DevelopmentSubflows
© 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
© 2012 IBM Corporation
Effective Application DevelopmentApplications and Libraries
© 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
© 2012 IBM Corporation
Effective Application DevelopmentServices
© 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)
© 2012 IBM Corporation
Effective Application DevelopmentPatterns
© 2012 IBM Corporation22
The Challenge
From:MQ
File
WSDL
To:
© 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
© 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
© 2012 IBM Corporation
Effective Application DevelopmentMobile
© 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
© 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
© 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
© 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
© 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)
© 2012 IBM Corporation
Effective Application DevelopmentPattern Authoring
© 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
© 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!
© 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
© 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
© 2012 IBM Corporation
Packaging a Pattern
36
© 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!
© 2012 IBM Corporation
Message Broker APIMigration, Mash-ups, On-demand Applications…
© 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
© 2012 IBM Corporation
Effective Application DevelopmentDebug and Test
© 2012 IBM Corporation
Debugging Applications
Message Broker has excellent real time debugging facilities built-in:
41
© 2012 IBM Corporation
Unit Test Client
42
© 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