The IBM MQ Light API makes it simple for developers to create responsive applications that are easy to scale without having to become messaging experts. Increasingly, development teams choose from a wide variety of languages, so the MQ Light API is available in a range of popular languages such as Ruby and Python, with the syntax tailored to fit naturally in each. The same API can be used with MQ Light installed on a laptop, with enterprise MQ queue managers, or in the cloud with the Message Hub service, so you can move seamlessly between these environments. Come and see how this API can make your developers more productive.
Direct Style Effect Systems -The Print[A] Example- A Comprehension Aid
HHM-3540: The IBM MQ Light API: From Developer Laptop to Enterprise Data Center to Cloud
1. MQ Light API
James Bennett
Product Management
Matthew Leming
MQ Development
2. 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.
1
3. Digital IT Enterprise IT
Cloud
On-Prem
Message Hub
(Based on Apache Kakfa)
H
Message-
Connect
2
Enterprise Messaging & Integration
Hybrid Messaging
MQ ExplorerMQ Client
Kafka API REST API
IBM MQ ApplianceIBM MQ
4. Message Hub
• A scalable, distributed, high throughput message bus based on Apache Kafka
• Wide compatibility via 3 APIs : REST, Kafka and MQ Light AMQP (coming soon)
• Tightly integrated with the Bluemix platform
MQ Light API
AMQP
RESTful API
HTTP
Apache Kafka
TCP
Streams
…
3
5. Challenges
• Enterprises need increased agility with improved administration
efficiency
“Applications deployed in 3 hours, not 3 months”
“Same size middleware team, more and more applications”
“The messaging system must be able to respond to change”
• Whilst retaining strong operational control and visibility
– Security
– Performance
– Availability
4
8. Different approaches
Connecting external
systems
Event driven
Worker offload
• Posting video to multiple social
sites after transcoding
• Respond to external events
• Updating external booking app
• Posting updates to twitter
• Image processing
• Text analytics
7
9. The MQ Light API
A. Simple Messaging Model
B. Idiomatic clients in fully supported languages across an
open wire protocol
C. Support across the IBM Messaging portfolio
8
10. Digital IT Enterprise IT
Cloud
On-Prem
Message Hub
(Based on Apache Kakfa)
MQ Light API
MQ Light API
H
Message-
Connect
9
Enterprise Messaging & Integration
Hybrid Messaging
MQ ExplorerMQ ClientMQ Light API
Kafka API REST API
IBM MQ ApplianceIBM MQ
11. 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
10
12. 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
11
13. 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
12
14. 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
13
15. 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
15
16. 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 messages
– Control over the number of unacknowledged messages delivered. (link credit)
16
17. MQ Light Node.JS API
• Installable from NPM
• Fully non blocking – Node.JS style
• Fluent programming style - wrappable into promises.
• Focussed on code simplicity.
• Client seamlessly retries across cloud endpoints
# Receive:
var mqlight = require('mqlight');
var recvClient = mqlight.createClient({service: 'amqp://localhost'});
recvClient.on('started', function() {
recvClient.subscribe('news/technology');
recvClient.on('message', function(data, delivery) {
console.log(data);
});
});
# Send:
var mqlight = require('mqlight');
var sendClient = mqlight.createClient({service: 'amqp://localhost'});
sendClient.on('started', function() {
sendClient.send('news/technology', 'Hello World!');
}); 17
18. Programming languages
Language Availability Notes
Node.js Supported IBM Client
Ruby Supported IBM Client
Java (Non Blocking) Supported IBM Client
Python IBM Client in Beta
PHP Qpid Proton
Scala Can use Java non Blocking client. Forum users report this working.
C/C++ Qpid Proton
Perl Qpid Proton
18
19. The plan
• Demo of worker offload pattern using MQ Light
– Start with local MQ Light server on laptop
– Upload the same code to Bluemix
• Using Node.js client
• Based off this tutorial but with some tweaks
– https://developer.ibm.com/messaging/2014/09/25/getting-started-node-js-
mq-light-apps-bluemix
19
20. Code overview
• User types in words into browser
• Words sent to workers and upper cased
• Words returned to browser
Front
end
(Node)
Browser
Worker 1
(Node)
MQ
Light
POST
Publish
mqlight/sample/words
Subscribe
mqlight/sample/wordsuppercase
GET
(polling)
Publish
mqlight/sample/wordsuppercase
Subscribe
mqlight/sample/words
share = common-back-end
1
2
3
4
5
6
20
on(message, …)
on(message, …)
29. 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
29
30. The MQ Light API
A. Simple Messaging Model
B. Idiomatic clients in fully supported languages across an
open wire protocol
30
31. MQ Light Node.JS API
• Installable from NPM
• Fully non blocking – Node.JS style
• Fluent programming style - wrappable into promises.
• Focussed on code simplicity.
• Client seamlessly retries across cloud endpoints
# Receive:
var mqlight = require('mqlight');
var recvClient = mqlight.createClient({service: 'amqp://localhost'});
recvClient.on('started', function() {
recvClient.subscribe('news/technology');
recvClient.on('message', function(data, delivery) {
console.log(data);
});
});
# Send:
var mqlight = require('mqlight');
var sendClient = mqlight.createClient({service: 'amqp://localhost'});
sendClient.on('started', function() {
sendClient.send('news/technology', 'Hello World!');
}); 31
32. The MQ Light API
A. Simple Messaging Model
B. Idiomatic clients in fully supported languages across an
open wire protocol
C.Support across the IBM Messaging portfolio
32
33. Digital IT Enterprise IT
Cloud
On-Prem
Message Hub
(Based on Apache Kakfa)
MQ Light API
MQ Light API
H
Message-
Connect
33
Enterprise Messaging & Integration
Hybrid Messaging
MQ ExplorerMQ ClientMQ Light API
Kafka API REST API
IBM MQ ApplianceIBM MQ
37. Where can I get more information?
IBM Messaging developerWorks
developer.ibm.com/messaging
IBM Messaging Youtube
https://www.youtube.com/IBMmessagingMedia
LinkedIn
Ibm.biz/ibmmessaging
Twitter
@IBMMessaging
IBM MQ Facebook
Facebook.com/IBM-MQ-8304628654/
37
38. Monday
10:30-11:30 3592 New MQ features
3452 Managing applications
12:00-13:00 2835 MQ on z/OS and Distributed
15:00-16:00 3470 Latest MQ z/OS features
2833 Where is my message?
3544 MQ Light in an MQ infrastructure
16:30-17:30 3573 Hybrid cloud messaging
2941 MQ Advanced
Tuesday
08:30-09:30 3540 The MQ Light API
12:00-13:00 3456 The IBM MQ Appliance
13:15-14:15 3499 Introducing Message Hub
3458 MQ Appliance administration
14:30-15:30 6432 MQ updates and futures (InnerCircle)
2849 Messaging feedback roundtable
16:00-17:00 3544 MQ Light in an MQ infrastructure
3513 MQ hands on lab
Wednesday
08:30-09:30 3602 Managing your MQ environment
12:00-13:00 3613 Designing MQ self service
6408 Hybrid messaging roadmap (InnerCircle)
13:15-14:00 3416 HA and DR with MQ
3433 Why secure your messaging?
15:45-16:30 3429 Securing MQ
2847 Meet the messaging experts
16:00-17:00 3508 MQ Light hands on lab
16:45-17:30 2275 Migrating to the IBM MQ Appliance
Thursday
08:30-09:15 3420 MQ Clustering
2931 Business agility with self service MQ
09:30-10:15 3479 MQ z/OS clusters and shared queue
3450 Optimising MQ applications
2849 Messaging feedback roundtable
10:30-11:15 3465 MQ Appliance high availability
3481 MQ z/OS messaging connectivity
11:30-12:15 3474 Active-active messaging
3537 Monitoring and managing MQ
3425 MQ publish/subscribe
Find us at the EXPO:
Hybrid Integration peds 65-68
Check out the Hybrid Messaging sub topic under the
Hybrid Integration topic for further customer and business
partner sessions
Hybrid Messaging from the IBM experts at InterConnect 2016
Sunday
14:30-15:30 6408 Hybrid messaging roadmap (InnerCircle)
41. Notices and Disclaimers Con’t.
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not
tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products.
Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the
ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained h erein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual
property right.
IBM, the IBM logo, ibm.com, Aspera®, Bluemix, Blueworks Live, CICS, Clearcase, Cognos®, DOORS®, Emptoris®, Enterprise Document Management System™, FASP®,
FileNet®, Global Business Services ®, Global Technology Services ®, IBM ExperienceOne™, IBM SmartCloud®, IBM Social Business®, Information on Demand, ILOG,
Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®,
PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, Smarter Commerce®, SoDA, SPSS, Sterling Commerce®,
StoredIQ, Tealeaf®, Tivoli®, Trusteer®, Unica®, urban{code}®, Watson, WebSphere®, Worklight®, X-Force® and System z® Z/OS, are trademarks of International Business
Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM
trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
41
42. Thank You
Your Feedback is Important!
Access the InterConnect 2016 Conference Attendee
Portal to complete your session surveys from your
smartphone,
laptop or conference kiosk.
The objective today is for you to all leave with 3 things:
An understanding of why we have created the MQ Light API
An understanding of how it works, including us proving it with a demo
And finally, clear direction on next steps
Want to compare the motivations and priorities of Andy & Iain
Andy : apps that can scale, apps that will remain responsive, ensuring heavy lifting doesn’t get in the way of the user experience
Iain : ensuring systems remain running no matter what, ensure changes are planned to minimise unexpected impact on critical business systems, Ensuring things are connected in a managed way
How things have evolved technologically
Used to be a handful of languages,
Explosion of languages that people want to use (each has their specific benefits)
Even larger explosion of frameworks within these languages.
The objective today is for you to all leave with 3 things:
An understanding of why we have created the MQ Light API
An understanding of how it works, including us proving it with a demo
And finally, clear direction on next steps
The objective today is for you to all leave with 3 things:
An understanding of why we have created the MQ Light API
An understanding of how it works, including us proving it with a demo
And finally, clear direction on next steps