Upload
robert-nicholson
View
790
Download
3
Embed Size (px)
DESCRIPTION
IBM Impact 2014 session 1897. Messaging in the cloud with ElasticMQ, MQ Light and Bluemix.
Citation preview
© 2014 IBM Corporation
Session 1897: Messaging in
the cloud with Elastic MQ,
MQ Light and BlueMix
Rob Nicholson : [email protected] @nicholsr
STSM , Application Messaging
#ibmimpact #mqlight #elasticmq
Please Note
IBM’s statements regarding its plans, directions, and intent are subject to change
or withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general
product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a
commitment, promise, or legal obligation to deliver any material, code or
functionality. Information about potential future products may not be incorporated
into any contract. The development, release, and timing of any future features or
functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM
benchmarks in a controlled environment. The actual throughput or performance
that any user will experience will vary depending upon many factors, including
considerations such as the amount of multiprogramming in the user’s job stream,
the I/O configuration, the storage configuration, and the workload processed.
Therefore, no assurance can be given that an individual user will achieve results
similar to those stated here.
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Application Messaging
Introduction to Elastic MQ Service
MQ Light Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
2
#ibmimpact #mqlight #elasticmq
The next billion
dollar idea starts
with a single
developer.
That developer
starts with a single
line of code
#ibmimpact #mqlight #elasticmq
Codename: BlueMix Delivering a Composable Services development environment
Run Your Apps The developer can chose any language runtime or
bring their own. Just upload your code and go.
DevOps Development, monitoring, deployment and
logging tools allow the developer to run the
entire application
APIs and Services A catalog of open source, IBM and third party
APIs services allow a developer to stitch
together an application in minutes.
Cloud Integration Build hybrid environments. Connect to on-
premises systems of record plus other public and
private clouds. Expose your own APIs to your
developers.
Built on IBM SoftLayer Runs automatically on top of IBM’s leading
infrastructure as a service. No need to worry
about provisioning or managing infrastructure.
#ibmimpact #mqlight #elasticmq
TOTAL CONTRIBUTORS
LINES OF CODE
PULL REQUESTS PUBLIC REPOSITORIES
1,118 Average per month
2013 average: 133
12mo average: 98
Lifetime average: 58
646k
1025+ 133+
Embracing Cloud Foundry Continuing our history of embracing and extending Open Source
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Application Messaging
Introduction to Elastic MQ Service
MQ Light Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
6
#ibmimpact #mqlight #elasticmq
IBM Messaging portfolio
Enable developers to build more scalable, responsive applications Focus on application developer use cases, breadth of language support, no administration, ease-of-deployment, lightweight & powerful API, as software or a cloud service
Deliver Messaging Backbone for Enterprise Focus on traditional MQ values, rock-solid enterprise-class service, ease-of-operation, breadth of platform coverage, availability, z/OS exploitation
Capture Big Data from Mobile and Internet of Things Focus on Internet-scale events, m2m device enablement, security and privacy, feed into real-time analytics, location-based notifications
7
#ibmimpact #mqlight #elasticmq
Application Messaging : MQ Light & ElasticMQ.
Messaging for application developers to help
create responsive applications that scale
easily
Trivially easy to get started;
no setup, no configuration, no administration
Available as software download or full cloud
service in Codename : BlueMix
APIs crafted specifically for each language
Tooling that supports app development
Software
Cloud Service
8
#ibmimpact #mqlight #elasticmq
The journey that got us here…
Previous developer / IT relationship
• Driven by centrally controlled common standards
• Carefully planned projects delivering core business systems
• Focused on re-using existing skills and investments
9
Jon
IT mgmt
Must use approved IT services
Share, re-use and save!
I need to access some messaging services. I own the apps. Demand for
Infrastructure
services Andy
Developer
Iain
Infrastructure
Guy
#ibmimpact #mqlight #elasticmq
The journey that got us here…
Evolving developer / IT relationship
• Driven by business sponsor demands
• Developers download and use the tools to get the job done
• Focused on trying new apps and concepts in the market
Beth
Business
Sponsor
Reduced pull
for services Andy
Developer
Iain
Infrastructure
Guy
What handy tools can I grab?
10
#ibmimpact #mqlight #elasticmq
The journey that got us here…
11
Ruby
Node.js
Python
C
C++
Java
C#
Perl
Go
Clojure
Lua
Erlang Scala
PHP
Cobol
#ibmimpact #mqlight #elasticmq
Trend in Cloud Application Architecture
12
HTML + Client Side
javascript
Business Logic
HTML + Client Side
javascript
Data Data Data
•Test, deploy, operate as a whole.
•Often Scale monolithic app
•Powerful integration runtimes.
•Homogeneous technologies
•Small empowered dev-ops teams own each
service.
•Test, deploy, monitor, operate individual
services.
•Polyglot languages & persistence.
•Services scale automatically as needed.
Micro services
Data Centre Architecture Cloud – centric Architecture
Caveat: Oversimplification
#ibmimpact #mqlight #elasticmq
Trend in Cloud Application Architecture
13
HTML + Client Side
javascript
Data Data
Micro services
Cloud – centric Architecture
Interaction via REST and
lightweight asynchronous
messaging.
#ibmimpact #mqlight #elasticmq
Use Cases
14
Intensive work offloaded and distributed amongst
worker processes to be performed asynchronously
- Processing images or videos
- Performing text analytics
Event Driven
Take one or more actions when something
interesting happens
- Email logs and update dashboards when build finishes
- Upload videos once finished transcoding
MQ
Lig
ht
MQ
Lig
ht
Worker Offload
#ibmimpact #mqlight #elasticmq
Use Cases
15
Schedule a task to happen at a specific point in
time
- Run in detailed reports when app use is low
- Generate end of day summary
Ensure applications remain responsive even when
3rd party system are not available or responding
fast enough
- Updating existing CRM system
- Booking appointment
MQ
Lig
ht
MQ
Lig
ht
Delayed Processing
3rd Party Integration
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Application Messaging
Introduction to Elastic MQ Service
MQ Light Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
16
#ibmimpact #mqlight #elasticmq
Elastic MQ Service
17
#ibmimpact #mqlight #elasticmq
Elastic MQ Runtime connectivity
18
.php
……
.py
Community support. IBM
Priority based on feedback.
#ibmimpact #mqlight #elasticmq
Elastic MQ with Java
JMS 1.1 API
• Pub/Sub and Queue
• Local Transactions only.
• Java SE model
• Java EE Model including MDBs
19
JMS JMS
#ibmimpact #mqlight #elasticmq
Elastic MQ with Node.js using MQ Light API
20
MQ
Light
MQ
Light
Simple, programming Language neutral messaging model
Idiomatic language & framework API Mappings
• Frictionless development
Open wire protocol & Open source client libraries
• Facilitates community drivers for languages & frameworks
MQ Light API
#ibmimpact #mqlight #elasticmq
Polyglot Messaging
21
MQ
Light
.rb
……
.py Community
support. IBM
Priority based on
feedback.
JMS
Mapping from JMS to MQ Light enables apps using polyglot
model.
Worker offload with workers implemented in different
languages.
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Application Messaging
Introduction to Elastic MQ Service
MQ Light Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
22
#ibmimpact #mqlight #elasticmq
Application messaging deployment options
Developer coding in
range of
languages/frameworks.
WebSphere MQ (Statement of Direction)
MQ Light (Beta)
Deploy seamlessly to MQ Light, MQ or
Elastic MQ
Builds application and uses MQ
Light messaging and tests in local
developer sandbox
23
Codename: Bluemix
Elastic MQ Service (Beta)
#ibmimpact #mqlight #elasticmq
24
MQ Light API - Runtimes
MQ
Lig
ht A
PI
MQ
Lig
ht A
PI
Open
Wire
Protocol
Codename: Bluemix
Elastic MQ Service (Beta)
WebSphere MQ (Statement of Direction)
MQ Light (Beta)
app
#ibmimpact #mqlight #elasticmq
MQ Light – in open beta now.
25
#ibmimpact #mqlight #elasticmq
26
MQ Light Messaging Model – Send Messages
Applications send messages to a topic.
A topic is an address in the topic space
either flat or arranged hierarchically.
1. Send (‘/test/a’, “Hello”);
2. Send (‘/test/a’, “World!”);
Topic Address Space
Sender application
#ibmimpact #mqlight #elasticmq
27
MQ Light Messaging Model – Simple Receive
•Applications receive messages by creating a destination with a pattern
which matches the topics they are interested in.
•Pattern matching scheme based on WMQ.
1. Send (‘/test/a’, “Hello”);
2. Send (‘/test/a’, “World!”);
1. Hello
2. World!
Topic Address Space
Sender application
DESTINATION
Pattern=/test/a
#ibmimpact #mqlight #elasticmq
28
MQ Light Messaging Model – Pub/Sub
•Multiple destinations can be created which match the same topic
•Pub/Sub style.
DESTINATION
1. Send (‘/test/a’, “Hello”);
2. Send (‘/test/a’, “World!”);
1. Hello
2. World!
1. Hello
2. World!
Topic Address Space
Sender application
DESTINATION
Pattern=/test/a
Pattern=/test/#
Client 1
Client 2
#ibmimpact #mqlight #elasticmq
29
MQ Light Messaging Model – Persistent destinations
•Destinations persist for a defined “time to live” after receiver detaches.
1. Send (‘/test/a’, “Hello”);
2. Send (‘/test/a’, “World!”);
Topic Address Space
Sender application
Hello
World!
DESTINATION
Pattern=/test/a
Disconnected client
#ibmimpact #mqlight #elasticmq
30
MQ Light Messaging Model – Sharing
•Clients attaching to the same topic pattern and share name attach to the
same shared destination.
DESTINATION 1. Send (‘/test/a’, “Hello”);
2. Send (‘/test/a’, “World!”);
1. Hello
2. World!
1. Hello
2. World!
SHARING
Topic Address Space
Sender application
DESTINATION
Pattern=/test/#
Pattern=/test/#
Share=myshare
Client 1
Client 2
Client 3
#ibmimpact #mqlight #elasticmq
MQ Light Messaging Model - Message Delivery
Currently: At most once delivery (QoS 0)
On the backlog:
• At least once delivery (QoS 1)
• Acknowledge & Reject messages
• Control over the number of unacknowledged messages
delivered. (Readahead)
• require Destination – Results in a error if a destination does not
exist for the message.
31
#ibmimpact #mqlight #elasticmq
MQ Light Messaging Model – Messages
Messages have a payload which is either Text or Binary.
• Content-type is used by clients to transfer JSON
On the backlog:
• Messages can have:
– Time-to-live
– Delivery delay
– Properties
32
#ibmimpact #mqlight #elasticmq
33
MQ Light Messaging Model – Client takeover
1. Send (‘/test/a’, “Hello”);
Hello
Topic Address Space
Sender application
DESTINATION
Pattern=/test/#
Client 1
World!
Client 1
2. Send (‘/test/a’, “World!”);
•Applications connect to MQ Light service specify (optional) client ID.
•Re-using the same client ID pre-empts the original connection.
•Ideal for worker takeover in the cloud.
#ibmimpact #mqlight #elasticmq
MQ Light Node.JS API.
Installable from NPM
Promotes a fluent programming style
Easily wrappable into promises.
Focussed on code simplicity.
Client - connect state machine
• Assists cloud applications.
34
client.connect()
.on('connected', function() {
console.log('Have some random cat names. Have them!');
subscribe('/kittens');
})
.on('disconnected', function() {
console.log('That's enough for now!');
})
.on('message', function(data) {
console.log('Why not call your cat: '+data);
});
#ibmimpact #mqlight #elasticmq
Developer-centric MQ Light GUI
35
•Available today in MQ Light software beta.
•On the backlog (near the top!) for Elastic MQ Service in Bluemix.
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Application Messaging
Introduction to Elastic MQ Service
MQ Light Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
36
#ibmimpact #mqlight #elasticmq
Elastic MQ Service
Supports MQ Light API & JMS
Connection details for both are
present VCAP_SERVICES
Client Libraries injected into
runtimes
• Node.JS
– Specify dependency on mqlight in
package.json
• Java
– When JMS use is detected by
liberty buildpack.
37
#ibmimpact #mqlight #elasticmq
ElasticMQ JMS Support
Support “Java SE” style messaging.
• Either read connection details from VCAP_SERVICES
• Or use the connection helper
• Inlcude the WMQ JMS client libraries
• Push to bluemix as .jar
Supports Liberty Profile “JEE” style messaging.
• Either push a .WAR
– Resource Adapter injected and JNDI namespace populated by
Liberty buildpack.
• Or push a packaged liberty server
– Supports MDBs
38
WebSphereMQServiceConnectionHelper connHelper= WebSphereMQServiceConnectionHelper
.getWebSphereMQServiceConnectionFactory();
MQConnectionFactory cf=(MQConnectionFactory)connHelper.getJmsConnectionFactory();
#ibmimpact #mqlight #elasticmq
Using MDBs with Elastic MQ in Liberty
39
Java
Server.xml
#ibmimpact #mqlight #elasticmq
JMS to MQ Light Interoperability
MQ Light String JMS Text Message
MQ Light Binary Message JMS Bytes message
JMS Topic space appears as MQ light topic address space.
40
#ibmimpact #mqlight #elasticmq
Agenda
Introduction to Bluemix
Introduction to Elastic MQ Service
MQ Light
• Messaging API and Graphical tools
Elastic MQ Service in depth
Demo
41
#ibmimpact #mqlight #elasticmq
Demo Scenario
Twitter sentiment analysis
application.
Tracks a number of
“products”.
42
Live Twitter feed
Cumulative interest
and sentiment
Relevant tweets
#ibmimpact #mqlight #elasticmq
Demo Architecture – Java workers
43
Twitter API
Web UI
Front end
node app
Analytics
workers
DESTINATION
(shared) Analysed tweets
tweets
#ibmimpact #mqlight #elasticmq
Demo Architecture – Node.JS workers
44
Twitter API
Web UI
Front end
node app
Analytics
workers
DESTINATION
(shared) Analysed tweets
tweets
#ibmimpact #mqlight #elasticmq
Related Sessions
MQ Light & ElasticMQ.
• What Is IBM WebSphere MQ Light & Why It Matters – AMC-1894
– Monday 4PM
• How to Develop Responsive Applications with IBM WebSphere MQ Light - AMC-1896
– Tuesday 10:30 AM
• Messaging in the Cloud with IBM WebSphere MQ Light & IBM BlueMix – AMC-1897
– Tuesday 3:45
• Hands-on Lab: Developing a First Application with IBM WebSphere MQ Light – AMC-1917
– Wednesday 10:30 AM
• Roundtable: IBM WebSphere MQ Light in a IBM WebSphere MQ Infrastructure - AMC-1924
– Wednesday 2:15 PM, Thursday 9 AM.
• Dev@IMPACT - Sands 304
– Tuesday 1PM- 6PM & Wednesday 1PM - 4PM.
Bluemix
• Codename: BlueMix Live – CSD-2782
– Tuesday 1PM
• Creating & Consuming Shared Services for Codename: BlueMix – CSD-2776
– Wednesday 10:30 AM
• Lab: Application Development with Codename: BlueMix – CSD-2227
– Tuesday 3:45 PM
45
Questions?
#ibmimpact #mqlight #elasticmq
We Value Your Feedback
Don’t forget to submit your Impact session and speaker
feedback! Your feedback is very important to us – we use it to
continually improve the conference.
Use the Conference Mobile App or the online Agenda Builder to
quickly submit your survey
• Navigate to “Surveys” to see a view of surveys for sessions
you’ve attended
47
Thank You
Rob Nicholson Senior Technical Staff Member
Software Group
+44 1962 817517
Twitter: nicholsr
Linkedin: uk.linkedin.com/in/robertbnicholson/
#ibmimpact #mqlight #elasticmq
Legal Disclaimer
• © IBM Corporation 2014. All Rights Reserved.
• The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained
in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are
subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing
contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and
conditions of the applicable license agreement governing the use of IBM software.
• References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or
capabilities referenced in this presentation may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to
future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by
you will result in any specific sales, revenue growth or other results.
• If the text contains performance statistics or references to benchmarks, insert the following language; otherwise delete:
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will
experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage
configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
• If the text includes any customer examples, please confirm we have prior written approval from such customer and insert the following language; otherwise delete:
All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs
and performance characteristics may vary by customer.
• Please review text for proper trademark attribution of IBM products. At first use, each product name must be the full name and include appropriate trademark symbols (e.g., IBM
Lotus® Sametime® Unyte™). Subsequent references can drop “IBM” but should include the proper branding (e.g., Lotus Sametime Gateway, or WebSphere Application Server).
Please refer to http://www.ibm.com/legal/copytrade.shtml for guidance on which trademarks require the ® or ™ symbol. Do not use abbreviations for IBM product names in your
presentation. All product names must be used as adjectives rather than nouns. Please list all of the trademarks that you use in your presentation as follows; delete any not included in
your presentation. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International
Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.
• If you reference Adobe® in the text, please mark the first use and include the following; otherwise delete:
Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
• If you reference Java™ in the text, please mark the first use and include the following; otherwise delete:
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
• If you reference Microsoft® and/or Windows® in the text, please mark the first use and include the following, as applicable; otherwise delete:
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
• If you reference Intel® and/or any of the following Intel products in the text, please mark the first use and include those that you use as follows; otherwise delete:
Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and
other countries.
• If you reference UNIX® in the text, please mark the first use and include the following; otherwise delete:
UNIX is a registered trademark of The Open Group in the United States and other countries.
• If you reference Linux® in your presentation, please mark the first use and include the following; otherwise delete:
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of
others.
• If the text/graphics include screenshots, no actual IBM employee names may be used (even your own), if your screenshots include fictitious company names (e.g., Renovations, Zeta
Bank, Acme) please update and insert the following; otherwise delete: All references to [insert fictitious company name] refer to a fictitious company and are used for illustration
purposes only.