+ All Categories
Home > Technology > Introduction to Patterns in WebSphere Message Broker

Introduction to Patterns in WebSphere Message Broker

Date post: 21-Nov-2014
Category:
Upload: ant-phillips
View: 4,464 times
Download: 5 times
Share this document with a friend
Description:
 
42
© 2012 IBM Corporation WebSphere Message Broker Introduction to Patterns Ant Phillips [email protected]
Transcript
Page 1: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

WebSphere Message Broker Introduction to Patterns

Ant [email protected]

Page 2: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation2

The Challenge

From:MQ

File

WSDL

To:

Page 3: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation3

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 4: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Generation

4

Pattern generation creates the production ready Message Broker projects– Generated projects reflect the configuration choices of the pattern user– Configuration is saved so that the pattern can be re-generated if required

Page 5: Introduction to Patterns in 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

5

Page 6: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Authoring

Page 7: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation7

Pattern Authoring

Patterns and pattern authoring are first class concepts

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

We always start with a working solution - one or more Broker projects

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 must bridge these two different approaches

Patterns have their own development cycle

Creating the working solution is part of the pattern authoring process

Page 8: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Authoring Workflow

8

Page 9: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Developing the Solution

9

Page 10: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Create Your Working Solution

10

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 creating a good pattern is to create a good working solution!

Page 11: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Define Your Target Properties

11

Page 12: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Authoring Workflow

12

Page 13: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Select Your Files and Resources

13

Selects the projects and files which the pattern will include– Clicking on a message flow displays any target properties in that file– Patterns can include many different types of Message Broker projects

Page 14: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Configure Your Pattern Parameters

14

Pattern parameters prompt information from pattern users– Pattern groups organise parameters into related areas– Parameters map to target properties in the message flows

Page 15: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation15

Pattern Parameters and Groups

Add field prompts and help information to pattern parameters and groups:

Page 16: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation16

Refine Your User Interface

Refine the pattern user interface by using the specialist field editors– Add XPath expressions to control when a pattern parameter is required– Enumerations allow you to present a well defined list of options to a pattern user

Page 17: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Add Your Pattern Categories

17

User-defined categories are displayed in the Patterns Explorer– Use the built-in categories or add your own pattern categories– Categories include a description authored in regular HTML– Easy to add style sheets, images and any other files as required

Page 18: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Test Your Pattern

18

Page 19: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Test Your Pattern

19

Click Test Pattern and a second workbench is started ready for testing– Extra metadata can also be configured such as version number and vendor name– Patterns are implemented by plug-ins which are created in your workspace

Page 20: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Refinement

Page 21: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Overview

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

21

Page 22: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Java and PHP code

Easy to attach Java code and PHP templates to a pattern– Code is invoked in top down order as shown in the Pattern Authoring editor

22

Page 23: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

The MessageFlow API contains all the nodes, connections and artefacts present in the message flow

The Message Flow API includes properties, nodes and connections– This is not an exhaustive list – essentially equivalent to the Message Flow editor

User Defined Nodes are represented as GenericNode

23

Message Broker API

Page 24: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

PHP

PHP is a general purpose dynamic scripting language

Easy to use with a gentle learning curve

Efficient syntax and library have evolved in open source–Community driven to get more done in less time–Impressive results with little code–Extensive library support–Language well suited to rapid prototyping

More than 3 million developers worldwide

4th most populate language after Java, C and Visual Basic

Message Broker PHP Compute Node since v6.1.0.4– Java implementation, fully compliant with PHP version 5.2

24

Page 25: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

PHP Templates

25

Output from PHP template is written straight to the generated project

Page 26: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Communities

Page 27: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Distribute Your Pattern

27

Page 28: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Communities

Pattern authoring creates patterns whose value multiplies as they are shared and used by a community of developers

Public and private communities are equally interesting!

A community needs to offer more than just a repository of assets!– Space for content such as patterns and subflow nodes– Forums to host discussions and threaded conversations– Categorisation is important as the community grows! (taxonomies)– Essential administrative functions such as user management– News articles and broadcasts keep the site fresh

There are literally dozens of content management systems available

On the commercial side we have tried Lotus Connections and Rational Asset Manager

Open source projects such as Drupal and Joomla are compelling!

28

Page 29: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Packaging a Pattern

29

Page 30: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Archives

The goal is to simplify the packaging and distribution of patterns

Creating Eclipse update sites and features is a fairly complex task

Code projects are automatically packaged and distributed

A pattern archive contains the pattern plug-ins and an Eclipse feature– The version of the feature matches the pattern version:

30

Page 31: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Creating a Community Space

31

Page 32: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

A Shared Repository for Patterns

32

Page 33: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Drupal

The demonstration system is a standard Drupal v6 install– Drupal is a PHP-based open-source content management system (CMS)– A key strength of Drupal is its vibrant community of users and developers– Drupal has an extensive list of many hundreds of add-on modules

The following contributed modules were installed:– Voting is provided by FiveStar and VotingAPI modules – Site search is configured (this is a built in module) – An easy to use Administration module is available – Pages based around an image are provided by the Image module – Categorisation of content made available by the Taxonomy module

It took just over one hour to complete the system set up!

33

Page 34: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Community Branding

34

Page 35: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Install Your Pattern

35

Page 36: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Installing Patterns

The Pattern Explorer provides a download capability for pattern archives

Pattern archives can be installed from a local file system or from a URL

HTTP/S is not supported – instead login, download and install from the file system

Installation completes without a toolkit restart

Patterns are uninstalled through the Eclipse updates feature: Help > Software Updates

.patternzip files can also be double clicked which runs an installer application (the file extension is registered by the toolkit)

36

Page 37: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Bringing It All Together!

Page 38: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Microsoft .NET Service Enablement

38

How quickly can you build a web service using a .NET application?

– Creating a service where one doesn’t currently exist is service enablement

– Excellent opportunity to show case new features in Message Broker

• Applications and libraries, deployable WSDL/XSD, Pattern Authoring enhancements

Page 39: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Configuring the Microsoft .NET Assembly

39

User-defined editor allows the pattern user to select their .NET assembly

– Selection proceeds to a class and the (static) methods available in that class

– Assembly can be developed in any .NET language (for example, VB.NET or C#)

– Return value and parameters are reflected on and displayed by the user-defined editor

Page 40: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Projects Generated by the Pattern

40

The pattern generates an application and a library

– Application contains the mechanics of the pattern instance

– Library contains subflows for user customizations

– Customizations are never deleted on re-generation!

WSDL created to represent the selected .NET methods

– One WSDL operation for each .NET (static) method

– Likewise one message part defined per operation

– WSDL types are defined in a separate XML schema file

– WSDL and XSD are deployed directly to Message Broker

Page 41: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Microsoft .NET Data Types

41

CLR Data Type(System.*)

XSD (WSDL) ESQL

Int32 xsd:integer INT

Int64 xsd:long INTEGER

Decimal xsd:decimal DECIMAL

Double xsd:float FLOAT

Byte[] xsd:hexBinary BLOB

String xsd:string CHARACTER

Char xsd:string CHAR

Boolean xsd:boolean BOOLEAN

DateTimeOffset xsd:dateTime TIMESTAMP

TimeSpan xsd:time TIME

DateTime xsd:dateTime GMTTIMESTAMP

The table shows the mapping from .NET data types to ESQL and XSD Value types declared as Nullable<> are also supported (relevant for value types)

Page 42: Introduction to Patterns in WebSphere Message Broker

© 2012 IBM Corporation

Pattern Design Points

Methods must be static, public and visible to be eligible for inclusion– Intention is to also support .NET instance methods by creating objects

No method overloading is currently supported by the pattern– Choose one method which is sufficient for the service definition

One class per service – create a wrapper class for aggregation

Exceptions thrown by.NET are returned as regular SOAP faults

42


Recommended