Successfully reported this slideshow.

Introduction to Patterns in WebSphere Message Broker


Published on

Published in: Technology

Introduction to Patterns in WebSphere Message Broker

  1. 1. Ant Phillips Message BrokerIntroduction to Patterns © 2012 IBM Corporation
  2. 2. The Challenge From: MQ File WSDL To:2 © 2012 IBM Corporation
  3. 3. 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 functionality3 © 2012 IBM Corporation
  4. 4. Pattern Generation 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 required4 © 2012 IBM Corporation
  5. 5. 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 release5 © 2012 IBM Corporation
  6. 6. Pattern Authoring © 2012 IBM Corporation
  7. 7. 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 process7 © 2012 IBM Corporation
  8. 8. Pattern Authoring Workflow8 © 2012 IBM Corporation
  9. 9. Developing the Solution9 © 2012 IBM Corporation
  10. 10. Create Your Working Solution 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!10 © 2012 IBM Corporation
  11. 11. Define Your Target Properties11 © 2012 IBM Corporation
  12. 12. Pattern Authoring Workflow12 © 2012 IBM Corporation
  13. 13. Select Your Files and Resources 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 projects13 © 2012 IBM Corporation
  14. 14. Configure Your Pattern Parameters Pattern parameters prompt information from pattern users – Pattern groups organise parameters into related areas – Parameters map to target properties in the message flows14 © 2012 IBM Corporation
  15. 15. Pattern Parameters and Groups Add field prompts and help information to pattern parameters and groups:15 © 2012 IBM Corporation
  16. 16. 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 user16 © 2012 IBM Corporation
  17. 17. Add Your Pattern Categories 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 required17 © 2012 IBM Corporation
  18. 18. Test Your Pattern18 © 2012 IBM Corporation
  19. 19. Test Your Pattern 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 workspace19 © 2012 IBM Corporation
  20. 20. Pattern Refinement © 2012 IBM Corporation
  21. 21. 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 projects21 © 2012 IBM Corporation
  22. 22. 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 editor22 © 2012 IBM Corporation
  23. 23. Message Broker API 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 GenericNode23 © 2012 IBM Corporation
  24. 24. 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.224 © 2012 IBM Corporation
  25. 25. PHP Templates Output from PHP template is written straight to the generated project25 © 2012 IBM Corporation
  26. 26. Pattern Communities © 2012 IBM Corporation
  27. 27. Distribute Your Pattern27 © 2012 IBM Corporation
  28. 28. 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 © 2012 IBM Corporation
  29. 29. Packaging a Pattern29 © 2012 IBM Corporation
  30. 30. 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 © 2012 IBM Corporation
  31. 31. Creating a Community Space31 © 2012 IBM Corporation
  32. 32. A Shared Repository for Patterns32 © 2012 IBM Corporation
  33. 33. 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 © 2012 IBM Corporation
  34. 34. Community Branding34 © 2012 IBM Corporation
  35. 35. Install Your Pattern35 © 2012 IBM Corporation
  36. 36. 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 © 2012 IBM Corporation
  37. 37. Bringing It All Together! © 2012 IBM Corporation
  38. 38. Microsoft .NET Service Enablement 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 enhancements38 © 2012 IBM Corporation
  39. 39. Configuring the Microsoft .NET Assembly 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 editor39 © 2012 IBM Corporation
  40. 40. Projects Generated by the Pattern 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 Broker40 © 2012 IBM Corporation
  41. 41. Microsoft .NET Data Types 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) CLR Data Type XSD (WSDL) ESQL (System.*) 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 GMTTIMESTAMP41 © 2012 IBM Corporation
  42. 42. 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 faults42 © 2012 IBM Corporation