C7: Messaging in the Cloud with IBM MQ Light and IBM Bluemix
Robert Nicholson, STSM for Application Messaging
@nicholsr #mqlight
© 2014 IBM Corporation
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.
2
© 2014 IBM Corporation
Agenda
Introduction to Bluemix
Application Messaging
Introduction to MQ Light Service
Demo
3
© 2014 IBM Corporation
The next billion
dollar idea starts
with a single
developer.
That developer
starts with a single
line of code
© 2014 IBM Corporation
IBM BlueMixDelivering a Composable Services development environment
Run Your AppsThe developer can chose any language runtime or
bring their own. Just upload your code and go.
DevOpsDevelopment, monitoring, deployment and
logging tools allow the developer to run the
entire application
APIs and ServicesA catalog of open source, IBM and third party
APIs services allow a developer to stitch
together an application in minutes.
Cloud IntegrationBuild 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 SoftLayerRuns automatically on top of IBM’s leading
infrastructure as a service. No need to worry
about provisioning or managing infrastructure.
© 2014 IBM Corporation
Agenda
Introduction to Bluemix
Application Messaging
Introduction to MQ Light Service
Demo
6
© 2014 IBM Corporation
IBM Messaging portfolio
7
Deliver Messaging Backbone for EnterpriseFocus 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 ThingsFocus on Internet-scale events, m2m device enablement, security and privacy, feed into real-time analytics, location-based notifications
Enable developers to build more scalable, responsive applicationsFocus on application developer use cases, breadth of language support, no administration, ease-of-deployment, lightweight & powerful API, as software or a cloud service
© 2014 IBM Corporation
MQ Light : Software and Cloud
Messaging that application developers will
love to use, helping them make responsive
applications that scale easily
3 ways to get it:
– Bluemix service
– MQ Light software download– Statement of Direction for support in MQ Version 8.
Open APIs crafted to feel natural in a
growing range of popular languages
Tooling that makes modular app
development easy
8
© 2014 IBM Corporation
The journey that got us here…
From:
Centrally planned IT Architecture
Emerges:
Business sponsor driven
Developer led architecture
Developers select tools to get the job done
Focused on trying new apps and concepts in
the market
Centrally controlled common standards
Planned projects delivering core systems
Focused on skills and investment reuse
© 2014 IBM Corporation
The journey that got us here…
10
Ruby
Node.js
Python
C
C++
Java
C#
Perl
Go
Clojure
Lua
Erlang Scala
PHP
© 2014 IBM Corporation
Use Cases
11
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
Worker Offload
© 2014 IBM Corporation
Use Cases
12
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
Delayed Processing
3rd Party Integration
© 2014 IBM Corporation
Trend in Cloud Application Architecture
13
HTML + Client Side
javascript
Business Logic
HTML + Client Side
javascript
Data DataData
•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
© 2014 IBM Corporation
Trend in Cloud Application Architecture
14
HTML + Client Side
javascript
DataData
Micro services
Cloud – centric Architecture
Interaction via REST and
lightweight asynchronous
messaging.
© 2014 IBM Corporation
Agenda
Introduction to Bluemix
Application Messaging
Introduction to MQ Light Service
Demo
15
© 2014 IBM Corporation
Introduction to MQ Light Service
16
© 2014 IBM Corporation
MQ Light with Node.js using MQ Light API
17
MQ
Light
MQ
Light
Simple, programming Language neutral messaging model
Idiomatic language & framework API Mappings
• Frictionless development
Open wire protocol (AMQP 1.0) & Open Source client libraries
• Facilitates community drivers for languages & frameworks
MQ Light API
MQ Light
.rb
……
.pyCommunity
support. IBM
Priority based on
feedback.
© 2014 IBM Corporation
MQ Light with Java
JMS 1.1 API
• Pub/Sub and Queue
• Local Transactions only.
• Java SE model
• Java EE Model including MDBs
18
JMS JMS
MQ Light
© 2014 IBM Corporation
Polyglot Messaging
19
MQ
LightJMS
Mapping from JMS to MQ Light enables apps using polyglot
model.
Worker offload with workers implemented in different
languages.
MQ Light
.rb
……
.py
© 2014 IBM Corporation
Tooling to assist development
Used to answer questions like :
• Where did this message come from?
• Where did that message go?
• What messages has my app consumed?
20
© 2014 IBM Corporation
21
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
© 2014 IBM Corporation
22
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
© 2014 IBM Corporation
23
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
© 2014 IBM Corporation
24
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
© 2014 IBM Corporation
25
MQ Light Messaging Model – Sharing
•Clients attaching to the same topic pattern and share name attach to the
same shared destination.
DESTINATION1. 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
© 2014 IBM Corporation
26
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.
© 2014 IBM Corporation
MQ Light Messaging Model
Messages
• Payload is either Text or Binary.
• Content-type is used by clients to transfer JSON
• Per message time to live.
Message delivery model
• At most once delivery (QoS 0)
• At least once delivery (QoS 1)
• Acknowledge & Reject messages
• Control over the number of unacknowledged messages
delivered. (link credit)
27
© 2014 IBM Corporation
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.
28
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);
});
© 2014 IBM Corporation
MQ Light Service JMS Support
Support “Java SE” style messaging.
• The WMQ classes for JMS now contain a provider service for
Bluemix.
• Include WMQ Classes & Push the app 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
29
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(JmsConstants.MQLIGHT_BLUEMIX_PROVIDER);
ConnectionFactory cf = ff.createConnectionFactory();
© 2014 IBM Corporation
Under the covers
App
Monitori
ng
& O
ps
Bluemix
Replicated GPFS
Filesystem
MQ Light service Runtime
QM
QM
QM
QM
QM
QM
QM
QM
ServiceLookup
MQ V8 Queue Managers with MQ
Light support.
Service architecture uses best practice
from our enterprise MQ Customers
Transformed for the cloud.
Reliability and availability underpinned
by:
Multi-instance queue managers
Replicated GPFS Fileysystem
24x7 Monitoring and Ops
support.
All running in Softlayer
App
© 2014 IBM Corporation
Agenda
Introduction to Bluemix
Application Messaging
Introduction to MQ Light Service
Demo
31
© 2014 IBM Corporation
Demo Scenario
Twitter sentiment analysis
application.
Tracks a number of
“products”.
32
Live Twitter feed
Cumulative interest
and sentiment
Relevant tweets
© 2014 IBM Corporation
Demo Architecture – Java workers
33
Twitter API
Web UI
Front end
node app
Analytics
workers
DESTINATION
(shared)Analysed tweets
tweets
MQ Light
© 2014 IBM Corporation
Demo Architecture – Node.JS workers
34
Twitter API
Web UI
Front end
node app
Analytics
workers
DESTINATION
(shared)Analysed tweets
tweets
MQ Light
© 2014 IBM Corporation
Summary
MQ Light : https://developer.ibm.com/messaging/mq-light/
MQ Light for Bluemix : www.bluemix.net
Messaging designed for developers to create responsive and scalable applications
– Simplified messaging API
– Easy to acquire and incorporate into applications
– Development focused tooling
Range of application deployment options
– MQ Light
– IBM MQ [Statement of Direction]
– MQ Light cloud service in BlueMix
35
© 2014 IBM Corporation
IBM MQ Sessions this week
10:30 - 12:00 13:15 - 14:15 14:30 - 15:30 16:00 - 17:00 17:15 - 18:15
Tu
es
da
y
Opening General Session- IBM Digital Experience
and WebSphere Technical University
Session A31: IBM MQ
CHLAUTH rules – with
MQ V8 updates
Speaker: Morag Hughson
Room 02
Session A4: WebSphere MQ
for z/OS: Performance and
Accounting
Speaker: Alexander Ross
Room 8
Session I26: DataPower-
MQ Connectivity Deep Dive
(Theory)
Speaker: Robin Wiley
Room 27
Session Z1: WebSphere MQ
for z/OS V8: Latest Features
Deep Dive
Speaker: Damon Cross
Room 6
9:00 - 10:00 10:30 - 11:30 11:45 - 12:45 14:00 - 15:00 15:15 - 16:15 16:45 - 17:45
We
dn
es
da
y
Session Z5:
WebSphere MQ for
z/OS: Security
Speaker: Damon Cross
Room 02
Session A21: What's New
in IBM Messaging
Speaker: Morag Hughson
Room 8
Session C7: Messaging
in the Cloud with IBM
MQ Light and IBM
Bluemix
Speaker: Rob Nicholson
Room 27
Session A17: Managing work-
loads, scaling and availability
with IBM MQ clusters
Speaker: David Ware
Room 6
Lab IL5: DataPower-MQ Connectivity Deep Dive (Hands-On)
Speaker: Robin Wiley
Room 7b
Session A9: WebSphere MQ
for z/OS: The Inside Story
Speaker: Damon Cross
Room 6
Th
urs
da
y
Session A35: How to
Develop Responsive
Applications with IBM MQ
Light
Speaker: Rob Nicholson
Room 27
Session A22: New IBM
MQ V8 Security
Features
Speaker: Morag Hughson
Room 01
Session A3: WebSphere MQ
for z/OS: Shared Queues
Speaker: Alex Ross
Room 6
Session A18: Using Publish
/Subscribe with IBM MQ
Speaker: David Ware
Room 27
Frid
ay
Lab AL6: Developing a First Application with IBM
WebSphere MQ Light
Speakers: Robert Nicholson, Alex Ross
Room 7b
Session A16: Using
IBM MQ Pub/Sub in an
MQ network
Speaker: David Ware
Room 6
© 2014 IBM Corporation
Questions?
37
© 2014 IBM Corporation
For Additional Information
IBM Training http://www.ibm.com/training
IBM WebSphere http://www.ibm.com/software/websphere/
http://www.ibm.com/software/products/ibm-mq
IBM developerWorks http://www.ibm.com/developerworks/websphere
https://www.ibm.com/developerworks/community/blogs/messaging
WebSphere forums and community http://www.ibm.com/developerworks/websphere/community/
Thank You
Rob NicholsonSenior Technical Staff Member
Software Group
+44 1962 817517
Twitter: nicholsr
Linkedin: uk.linkedin.com/in/robertbnicholson/
Your feedback is valuable - please complete your session evaluation
Either on paper or online at ibmeventconnect.eu/euxdx
Select Sessions, then Session Finder, and complete the survey
Session C7: Messaging in the Cloud with IBM MQ Light and IBM Bluemix