SlideShare a Scribd company logo
© 2015 IBM Corporation
Easy Integration of
Bluemix Services with
Your Applications
Junjie Cai
Bluemix runtime lead architect
Agenda
• Bluemix overview
• Using resource services in your Java web app
• Using operational services for your Java web app
• How it works
1
New Models of EngagementSystems of Record
Data & Transaction Integrity Smarter Devices & Assets
• Data & Transactions
• App Infrastructure
• Virtualized Resources
• Expanding Interface Modalities
• Big Data and Analytics
• Social Networking
Next
Generation
Architectures
New models of product & service innovation are emerging
2
Bluemix was built from the ground up with a user-based and design-centric approach.
It addresses these personas and key needs.
Our users include novice,
born-on-the-cloud, and
enterprise developers.
Want to compose
applications quickly with
useful APIs, to avoid
tedious backend config.
Expect fast time-to-value,
simplicity, flexibility, clear
documentation.
Failing
Fast
Seconds to
Deploy
Friction
Free
Any
Language
Continuous
Integration
Mobile
Ready
Focus on
Code
Choice of
Tools
Useful
APIs
Bluemix Goals:
Focus on the Cloud & Enterprise Application Developer
3
Bluemix: IBM’s Cloud Platform
• DevOps
• Big Data
• Mobile
• Watson
• Business Analytics
Bluemix service categories
• Database
• Web and application
• Security
• Internet of Things
• Integration
• Containers
• Virtual Machines
Developer experience
• Rapidly deploy and scale
applications in any language.
• Compose applications quickly
with useful APIs and services
and avoid tedious backend
config.
• Realize fast time-to-value with
simplicity, flexibility and clear
documentation.
Enterprise capability
• Securely integrate with existing
on-prem data and systems.
• Choose from flexible
deployment models.
• Manage the full application
lifecycle with DevOps.
• Develop and deploy on a
platform built on a foundation of
open technology.
Built on a foundation of open
technology.
Build, run, scale, manage, integrate & secure applications in the cloud
4
Bluemix embraces Cloud Foundry as an open source Platform as a
Service and extends it with IBM, third party, and community built runtime
and services.
How does Bluemix work?
5
The plain way to use a service in Bluemix
Step 1: Create & Bind the service
• Command line
– cf marketplace to see available services
– cf create-service to create a service instance
– cf bind-service to bind the service instance to your application
– cf restart, or cf restage/push again
• Web console (see demo)
– View service endpoint and credentials from VCAP_SERVICES environment variable:
6
The plain way to use a service in Bluemix (cont’)
Step 3: Read the credentials & invoke its API
Step 2: Provide the driver jar in your application
Drawbacks:
• Verbose code
• No connection pooling
7
There is an easier way to use these services
Modern
“resource”
Operational
services
Java EE
standard
“resource”
8
The Java EE way – Sample code for using SQLDB
9
public class TestServlet extends HttpServlet
{
@Resource (name = "jdbc/mydb")
private DataSource db;
...
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// Alternatively, use InitialContext lookup
DataSource lookup = (DataSource) new InitialContext().lookup("jdbc/mydb");
...
}
“mydb” is the name of the service
instance you create in Bluemix
That’s it! All familiar code, no changes required in order to
make it work in cloud!
• No need for a server.xml. Appropriate stanzas automatically generated.
• Don’t need to read VCAP_SERVICES
• Don’t need to provide a driver
Using the MQLite service – your familiar way again!
Develop responsive, scalable applications with a fully
managed messaging provider in the cloud. Quickly integrate
with application frameworks through easy to use APIs.
10
public class TestServlet extends HttpServlet
{
@Resource (name = "jms/emq")
private ConnectionFactory cf;
...
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// Alternatively, use InitialContext lookup
ConnectionFactory lookup =
(ConnectionFactory) new InitialContext().lookup(“jms/myemq");
...
}
More “resource” services accessible in the same way
11
MongoDB is an open source document database.
Improve the performance & user experience of web applications
by retrieving information from fast, managed, in-memory
caches, instead of relying entirely on slower disk-based
databases.
Cloudant NoSQL DB provides access to a fully managed
NoSQL JSON data layer that's always on. This service is
compatible with CouchDB, and accessible through a simple to
use HTTP interface for mobile and web application models.
11
Cloudant
public class TestServlet extends HttpServlet
{
@Resource (name = “cloudant/mycloudantdb")
private CouchDbInstasnce db;
...
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// Alternatively, use InitialContext lookup
CouchDbInstance db = (CouchDbInstance) new
InitialContext().lookup("cloudant/mycloudantdb");
CouchDbConnector dbc = _db.createConnector(DATABASE, true);
CouchDocument dbentry = new CouchDocument();
dbentry.setContent("testEntry");
dbc.create(dbentry);
}
“mycloudantdb” is the name of the
service instance you create in Bluemix
12
DataCache
public class TestServlet extends HttpServlet
{
@Resource (name = “wxs/myGrid")
private ObjectGrid og;
...
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// Alternatively, use InitialContext lookup
ObjectGrid og = (ObjectGrid) new
InitialContext().lookup(“wxs/myGrid");
...
}
“myGrid” is the name of the service
instance you create in Bluemix
13
MongoDB
import com.mongodb.DB;
public class TestServlet extends HttpServlet
{
@Resource (name = “cloudant/mymongo")
private DB db;
...
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// Alternatively, use InitialContext lookup
db = (DB) InitialContext().lookup("cloudant/mymongo");
...
}
“mymongo” is the name of the service
instance you create in Bluemix
14
Using operational services
15
Session Cache
• Improve application resiliency by storing session state information
across many HTTP requests.
• Enable persistence HTTP sessions for your application & seamless
session recovery in event of an application failure.
16
Auto-scaling
• The Auto-Scaling for Bluemix service enables you to automatically
increase or decrease the compute capacity of your application. The
number of application instances are adjusted dynamically based on
the Auto-Scaling policy you define.
17
Metric name Description
Supported
application type
CPU
The utilization percentage of
the CPU.
All
Memory
The usage percentage of
the memory.
All
JVM heap
The usage percentage of
the JVM heap memory.
Liberty for Java
Throughput
The number of the
processed requests per
second.
Liberty for Java
Monitoring & Analytics
• Gain the visibility and control you need over your application.
• Determine the response time your users see, understand the
performance and availability of the application components, and
leverage analytics to keep your application up and performing well.
18
Single Sign On
• Implement user authentication for your web and mobile apps quickly,
using simple policy-based configurations.
• Secure apps with confidence, not a lot of coding
• You choose the identity sources and we do the rest
19
New Relic
• New Relic is the all-in-one web app performance tool that lets you
see performance from the end user experience, through servers, and
down to the line of code.
20
Behind the scene –
Auto-Configuration Service plugin framework
• Allow service providers to customize runtime configuration
during application staging, triggered by the presence of a
service binding
• Available in both IBM Liberty & Node.js buildpacks
21
Users can also turn off Auto-Configuration and get the control
Disable individual services’ auto-configuration using the
services_autoconfig_excludes environment variable
Use a server package or server folder to take full control of the
server configuration
 Connection info in runtime-vars.xml as variables
 Provide a server.xml that reads these variables
 Push a server package or folder
22
Server configuration variables
Variables available via runtime-vars.xml (generated on cloud)
server.xml (you provide)
23
server.xml
...
<dataSource id="db2-mydb" jdbcDriverRef="db2-driver"
jndiName="jdbc/mydb" statementCacheSize="30"
transactional="true">
<properties.db2.jcc id="db2-mydb-props"
databaseName="${cloud.services.mydb.connection.db}"
user="${cloud.services.mydb.connection.username}"
password="${cloud.services.mydb.connection.password}"
portNumber="${cloud.services.mydb.connection.port}"
serverName="${cloud.services.mydb.connection.host}"/>
</dataSource>
...
Import javax.sql.DataSource;
public class MyServlet extends HTTPServlet
{
@Resource(name=“jdbc/somedb”)
private DataSource myDataSource;
… or ….
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup(“jdbc/somedb”);
}
1
2
3
• Allows the developer to use a JNDI
name different from the one defined
in server.xml
• Works only if there is a single service
instance defined in server.xml.
Any/all bindings will be auto-wired to
it.
Java EE Resource Auto-wiring for some IBM created
Bluemix services
24
25
Security
Services
Web and
application
services
Cloud
Integration
Services
Mobile
Services
Database
services
Big Data
services
Internet of
Things
Services
Watson
Services
DevOps
Services
Summary
• Use the rich set of Bluemix
services as building blocks
to quickly stand up your
applications
• Stick to the “standard” way
to access these “resource”
services, transparent to the
location
• Consume operational
services with just “one
click”
Notices and Disclaimers
Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or
transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with
IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been
reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM
shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY,
EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF
THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT
OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the
agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without
notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are
presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual
performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products,
programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not
necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither
intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal
counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s
business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or
represent or warrant that its services or products will ensure that the customer is in compliance with any law.
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 herein 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, Bluemix, Blueworks Live, CICS, Clearcase, DOORS®, Enterprise Document
Management System™, Global Business Services ®, Global Technology Services ®, Information on Demand,
ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™,
PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®,
pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, SoDA, SPSS, StoredIQ, Tivoli®, Trusteer®,
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.
Thank You
Your Feedback is
Important!
Access the InterConnect 2015
Conference CONNECT Attendee
Portal to complete your session
surveys from your smartphone,
laptop or conference kiosk.

More Related Content

PPT
Enterprise Software Architecture
PDF
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
PDF
AAI 1713-Introduction to Java EE 7
PPTX
Bluemix paas 기반 saas 개발 사례
PDF
CMPE282_009994036_PROJECT_REPORT
PPTX
Programming Azure Active Directory (DevLink 2014)
PPTX
Micro service architecture
PPTX
Web Basics
Enterprise Software Architecture
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
AAI 1713-Introduction to Java EE 7
Bluemix paas 기반 saas 개발 사례
CMPE282_009994036_PROJECT_REPORT
Programming Azure Active Directory (DevLink 2014)
Micro service architecture
Web Basics

What's hot (20)

PDF
Spring Into the Cloud
PDF
jsf2 Notes
PPT
Spring 3.1: a Walking Tour
PDF
What We Learned from Porting PiggyMetrics from Spring Boot to MicroProfile
DOCX
Krishnakumar Rajendran (1)
PDF
How lagom helps to build real world microservice systems
KEY
Multi client Development with Spring
PDF
Quality control in a cloudy world
KEY
Multi Client Development with Spring
DOCX
Rich Assad Resume
PDF
Lecture 11. Microsoft mobile services
PDF
Java Web Programming [3/9] : Servlet Advanced
PDF
Cloud Computing: Changing the software business
PDF
Microservice Come in Systems
PPTX
Java on Windows Azure
ODP
Google Web toolkit
DOCX
Server side programming bt0083
PPTX
Microsoft Windows Server AppFabric
PPTX
SFDC Inbound Integrations
PPT
DDD Framework for Java: JdonFramework
Spring Into the Cloud
jsf2 Notes
Spring 3.1: a Walking Tour
What We Learned from Porting PiggyMetrics from Spring Boot to MicroProfile
Krishnakumar Rajendran (1)
How lagom helps to build real world microservice systems
Multi client Development with Spring
Quality control in a cloudy world
Multi Client Development with Spring
Rich Assad Resume
Lecture 11. Microsoft mobile services
Java Web Programming [3/9] : Servlet Advanced
Cloud Computing: Changing the software business
Microservice Come in Systems
Java on Windows Azure
Google Web toolkit
Server side programming bt0083
Microsoft Windows Server AppFabric
SFDC Inbound Integrations
DDD Framework for Java: JdonFramework
Ad

Viewers also liked (20)

PDF
DockerDay2015: Deploy Apps on IBM Bluemix
PDF
What 'is' the Current Value of your ITSM?
PDF
IT4IT Reference Architecture : Blauwdruk voor het managen van de nieuwe IT
PDF
Automatiseren van IT activiteiten
PPTX
Changing Culture: Tips, tricks & transforming
PDF
10 trend in IT automation
PDF
A Deep Dive into the Liberty Buildpack on IBM BlueMix
PDF
IT4IT™ Reference Architecture in short.
PDF
IT4IT - itSMFUK v4 (3)
PPTX
Introducing The Open Group IT4IT™ Standard
PDF
Looking for Disruptive Business Models in Higher Education
PPTX
Running the Business of IT on ServiceNow using IT4IT
PDF
How to Operate in the Cloud Using ServiceNow, RightScale and More
PDF
How To Drive A Successful ServiceNow Implementation
PPTX
Business Architecture Explained
PDF
end-to-end service management with ServiceNow (English)
PDF
Request to Fulfill Presentation (IT4IT)
PPTX
IT4IT Overview (A new standard for IT management)
PDF
Business Architecture as an Approach to Connect Strategy & Projects
PDF
Understanding Business Architecture
DockerDay2015: Deploy Apps on IBM Bluemix
What 'is' the Current Value of your ITSM?
IT4IT Reference Architecture : Blauwdruk voor het managen van de nieuwe IT
Automatiseren van IT activiteiten
Changing Culture: Tips, tricks & transforming
10 trend in IT automation
A Deep Dive into the Liberty Buildpack on IBM BlueMix
IT4IT™ Reference Architecture in short.
IT4IT - itSMFUK v4 (3)
Introducing The Open Group IT4IT™ Standard
Looking for Disruptive Business Models in Higher Education
Running the Business of IT on ServiceNow using IT4IT
How to Operate in the Cloud Using ServiceNow, RightScale and More
How To Drive A Successful ServiceNow Implementation
Business Architecture Explained
end-to-end service management with ServiceNow (English)
Request to Fulfill Presentation (IT4IT)
IT4IT Overview (A new standard for IT management)
Business Architecture as an Approach to Connect Strategy & Projects
Understanding Business Architecture
Ad

Similar to Easy integration of Bluemix services with your applications (20)

PPT
Java Development on Bluemix
PPTX
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
PDF
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
PDF
Ten Minutes Bluemix Pitch from Dev to Dev
PPT
IBM Bluemix Talk at University College Cork (UCC)
PPT
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
PPTX
fiu-cloud-hackathon-lec1-v6
PPTX
MWLUG Bluemix
PPTX
Bluemix Overview & Demo
 
PDF
Bluemix introduction 20151219
PPTX
Bluemixoverview
PPTX
Bluemix - Overview & Benefits
PPTX
IBM Bluemix Overview
PPTX
How does IBM Bluemix work?
PPTX
Bluemix overview - UK WebSphere Integration User Group
PDF
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
PDF
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
PPTX
Boston Bluemix Meetup 5/15/14
PDF
IBM Bluemix Tech Meetup 18-02-2015
PDF
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...
Java Development on Bluemix
Migrating Java EE applications to IBM Bluemix Platform-as-a-Service
Migrating Java EE applications to IBM Bluemix platform as-a-service (CloudFou...
Ten Minutes Bluemix Pitch from Dev to Dev
IBM Bluemix Talk at University College Cork (UCC)
IBM Bluemix and Docker Guest Lecture at Cork Institute of Technology
fiu-cloud-hackathon-lec1-v6
MWLUG Bluemix
Bluemix Overview & Demo
 
Bluemix introduction 20151219
Bluemixoverview
Bluemix - Overview & Benefits
IBM Bluemix Overview
How does IBM Bluemix work?
Bluemix overview - UK WebSphere Integration User Group
IBM BlueMix Architecture and Deep Dive (Powered by CloudFoundry)
What is IBM Bluemix , Une nouvelle façon de coder , dans le cloud
Boston Bluemix Meetup 5/15/14
IBM Bluemix Tech Meetup 18-02-2015
135 . Haga el deploy de su aplicación en minutos y en cualquier lenguaje con ...

Recently uploaded (20)

PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
history of c programming in notes for students .pptx
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
iTop VPN Crack Latest Version Full Key 2025
PDF
Complete Guide to Website Development in Malaysia for SMEs
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
AutoCAD Professional Crack 2025 With License Key
PDF
Cost to Outsource Software Development in 2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
assetexplorer- product-overview - presentation
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Oracle Fusion HCM Cloud Demo for Beginners
Designing Intelligence for the Shop Floor.pdf
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Operating system designcfffgfgggggggvggggggggg
history of c programming in notes for students .pptx
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Monitoring Stack: Grafana, Loki & Promtail
Digital Systems & Binary Numbers (comprehensive )
Wondershare Filmora 15 Crack With Activation Key [2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
iTop VPN Crack Latest Version Full Key 2025
Complete Guide to Website Development in Malaysia for SMEs
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
AutoCAD Professional Crack 2025 With License Key
Cost to Outsource Software Development in 2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Why Generative AI is the Future of Content, Code & Creativity?
assetexplorer- product-overview - presentation
Reimagine Home Health with the Power of Agentic AI​
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)

Easy integration of Bluemix services with your applications

  • 1. © 2015 IBM Corporation Easy Integration of Bluemix Services with Your Applications Junjie Cai Bluemix runtime lead architect
  • 2. Agenda • Bluemix overview • Using resource services in your Java web app • Using operational services for your Java web app • How it works 1
  • 3. New Models of EngagementSystems of Record Data & Transaction Integrity Smarter Devices & Assets • Data & Transactions • App Infrastructure • Virtualized Resources • Expanding Interface Modalities • Big Data and Analytics • Social Networking Next Generation Architectures New models of product & service innovation are emerging 2
  • 4. Bluemix was built from the ground up with a user-based and design-centric approach. It addresses these personas and key needs. Our users include novice, born-on-the-cloud, and enterprise developers. Want to compose applications quickly with useful APIs, to avoid tedious backend config. Expect fast time-to-value, simplicity, flexibility, clear documentation. Failing Fast Seconds to Deploy Friction Free Any Language Continuous Integration Mobile Ready Focus on Code Choice of Tools Useful APIs Bluemix Goals: Focus on the Cloud & Enterprise Application Developer 3
  • 5. Bluemix: IBM’s Cloud Platform • DevOps • Big Data • Mobile • Watson • Business Analytics Bluemix service categories • Database • Web and application • Security • Internet of Things • Integration • Containers • Virtual Machines Developer experience • Rapidly deploy and scale applications in any language. • Compose applications quickly with useful APIs and services and avoid tedious backend config. • Realize fast time-to-value with simplicity, flexibility and clear documentation. Enterprise capability • Securely integrate with existing on-prem data and systems. • Choose from flexible deployment models. • Manage the full application lifecycle with DevOps. • Develop and deploy on a platform built on a foundation of open technology. Built on a foundation of open technology. Build, run, scale, manage, integrate & secure applications in the cloud 4
  • 6. Bluemix embraces Cloud Foundry as an open source Platform as a Service and extends it with IBM, third party, and community built runtime and services. How does Bluemix work? 5
  • 7. The plain way to use a service in Bluemix Step 1: Create & Bind the service • Command line – cf marketplace to see available services – cf create-service to create a service instance – cf bind-service to bind the service instance to your application – cf restart, or cf restage/push again • Web console (see demo) – View service endpoint and credentials from VCAP_SERVICES environment variable: 6
  • 8. The plain way to use a service in Bluemix (cont’) Step 3: Read the credentials & invoke its API Step 2: Provide the driver jar in your application Drawbacks: • Verbose code • No connection pooling 7
  • 9. There is an easier way to use these services Modern “resource” Operational services Java EE standard “resource” 8
  • 10. The Java EE way – Sample code for using SQLDB 9 public class TestServlet extends HttpServlet { @Resource (name = "jdbc/mydb") private DataSource db; ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Alternatively, use InitialContext lookup DataSource lookup = (DataSource) new InitialContext().lookup("jdbc/mydb"); ... } “mydb” is the name of the service instance you create in Bluemix That’s it! All familiar code, no changes required in order to make it work in cloud! • No need for a server.xml. Appropriate stanzas automatically generated. • Don’t need to read VCAP_SERVICES • Don’t need to provide a driver
  • 11. Using the MQLite service – your familiar way again! Develop responsive, scalable applications with a fully managed messaging provider in the cloud. Quickly integrate with application frameworks through easy to use APIs. 10 public class TestServlet extends HttpServlet { @Resource (name = "jms/emq") private ConnectionFactory cf; ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Alternatively, use InitialContext lookup ConnectionFactory lookup = (ConnectionFactory) new InitialContext().lookup(“jms/myemq"); ... }
  • 12. More “resource” services accessible in the same way 11 MongoDB is an open source document database. Improve the performance & user experience of web applications by retrieving information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases. Cloudant NoSQL DB provides access to a fully managed NoSQL JSON data layer that's always on. This service is compatible with CouchDB, and accessible through a simple to use HTTP interface for mobile and web application models. 11
  • 13. Cloudant public class TestServlet extends HttpServlet { @Resource (name = “cloudant/mycloudantdb") private CouchDbInstasnce db; ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Alternatively, use InitialContext lookup CouchDbInstance db = (CouchDbInstance) new InitialContext().lookup("cloudant/mycloudantdb"); CouchDbConnector dbc = _db.createConnector(DATABASE, true); CouchDocument dbentry = new CouchDocument(); dbentry.setContent("testEntry"); dbc.create(dbentry); } “mycloudantdb” is the name of the service instance you create in Bluemix 12
  • 14. DataCache public class TestServlet extends HttpServlet { @Resource (name = “wxs/myGrid") private ObjectGrid og; ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Alternatively, use InitialContext lookup ObjectGrid og = (ObjectGrid) new InitialContext().lookup(“wxs/myGrid"); ... } “myGrid” is the name of the service instance you create in Bluemix 13
  • 15. MongoDB import com.mongodb.DB; public class TestServlet extends HttpServlet { @Resource (name = “cloudant/mymongo") private DB db; ... protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Alternatively, use InitialContext lookup db = (DB) InitialContext().lookup("cloudant/mymongo"); ... } “mymongo” is the name of the service instance you create in Bluemix 14
  • 17. Session Cache • Improve application resiliency by storing session state information across many HTTP requests. • Enable persistence HTTP sessions for your application & seamless session recovery in event of an application failure. 16
  • 18. Auto-scaling • The Auto-Scaling for Bluemix service enables you to automatically increase or decrease the compute capacity of your application. The number of application instances are adjusted dynamically based on the Auto-Scaling policy you define. 17 Metric name Description Supported application type CPU The utilization percentage of the CPU. All Memory The usage percentage of the memory. All JVM heap The usage percentage of the JVM heap memory. Liberty for Java Throughput The number of the processed requests per second. Liberty for Java
  • 19. Monitoring & Analytics • Gain the visibility and control you need over your application. • Determine the response time your users see, understand the performance and availability of the application components, and leverage analytics to keep your application up and performing well. 18
  • 20. Single Sign On • Implement user authentication for your web and mobile apps quickly, using simple policy-based configurations. • Secure apps with confidence, not a lot of coding • You choose the identity sources and we do the rest 19
  • 21. New Relic • New Relic is the all-in-one web app performance tool that lets you see performance from the end user experience, through servers, and down to the line of code. 20
  • 22. Behind the scene – Auto-Configuration Service plugin framework • Allow service providers to customize runtime configuration during application staging, triggered by the presence of a service binding • Available in both IBM Liberty & Node.js buildpacks 21
  • 23. Users can also turn off Auto-Configuration and get the control Disable individual services’ auto-configuration using the services_autoconfig_excludes environment variable Use a server package or server folder to take full control of the server configuration  Connection info in runtime-vars.xml as variables  Provide a server.xml that reads these variables  Push a server package or folder 22
  • 24. Server configuration variables Variables available via runtime-vars.xml (generated on cloud) server.xml (you provide) 23
  • 25. server.xml ... <dataSource id="db2-mydb" jdbcDriverRef="db2-driver" jndiName="jdbc/mydb" statementCacheSize="30" transactional="true"> <properties.db2.jcc id="db2-mydb-props" databaseName="${cloud.services.mydb.connection.db}" user="${cloud.services.mydb.connection.username}" password="${cloud.services.mydb.connection.password}" portNumber="${cloud.services.mydb.connection.port}" serverName="${cloud.services.mydb.connection.host}"/> </dataSource> ... Import javax.sql.DataSource; public class MyServlet extends HTTPServlet { @Resource(name=“jdbc/somedb”) private DataSource myDataSource; … or …. InitialContext ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup(“jdbc/somedb”); } 1 2 3 • Allows the developer to use a JNDI name different from the one defined in server.xml • Works only if there is a single service instance defined in server.xml. Any/all bindings will be auto-wired to it. Java EE Resource Auto-wiring for some IBM created Bluemix services 24
  • 26. 25 Security Services Web and application services Cloud Integration Services Mobile Services Database services Big Data services Internet of Things Services Watson Services DevOps Services Summary • Use the rich set of Bluemix services as building blocks to quickly stand up your applications • Stick to the “standard” way to access these “resource” services, transparent to the location • Consume operational services with just “one click”
  • 27. Notices and Disclaimers Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM. Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided. Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice. Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation. It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law.
  • 28. 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 herein 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, Bluemix, Blueworks Live, CICS, Clearcase, DOORS®, Enterprise Document Management System™, Global Business Services ®, Global Technology Services ®, Information on Demand, ILOG, Maximo®, MQIntegrator®, MQSeries®, Netcool®, OMEGAMON, OpenPower, PureAnalytics™, PureApplication®, pureCluster™, PureCoverage®, PureData®, PureExperience®, PureFlex®, pureQuery®, pureScale®, PureSystems®, QRadar®, Rational®, Rhapsody®, SoDA, SPSS, StoredIQ, Tivoli®, Trusteer®, 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.
  • 29. Thank You Your Feedback is Important! Access the InterConnect 2015 Conference CONNECT Attendee Portal to complete your session surveys from your smartphone, laptop or conference kiosk.