Cloud Foundry for Spring Developers
Upcoming SlideShare
Loading in...5

Cloud Foundry for Spring Developers



This session provides an overview of how to build and deploy Spring-based applications to the Cloud Foundry platform. ...

This session provides an overview of how to build and deploy Spring-based applications to the Cloud Foundry platform.
The session will cover application configuration parameters, binding services to your application, deployment options using using STS, the vmc command tool, as well as the new Apache Maven plugin for Cloud Foundry. Gunnar will demonstrate how to deploy applications to both micro and public Cloud Foundry and will also show how debugging works with Cloud Foundry and how you can inspect services remotely using Caldecott.

Gunnar will also show various options to keep your War-files deployable to both Cloud Foundry and stand-alone Servlet Containers using auto-reconfiguration, the cloud namespace, and Spring 3.1 profiles.

Lastly, he will give a high-level overview how you can use Cloud Foundry together with Spring Integration in order to create scalable Spring applications.



Total Views
Views on SlideShare
Embed Views



7 Embeds 298 284 7 2 2 1 1 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Cloud Controller Main Brain
  • clone cloudfoundry-samples/hello-javamvn clean packagevmc helpvmc target http://api.cloudfoundry.comVmc info
  • ----- Meeting Notes (11/28/11 13:16) -----
  • Sometime Autoconfiguration is not sufficient

Cloud Foundry for Spring Developers Cloud Foundry for Spring Developers Presentation Transcript

  • Cloud Foundry for Spring DevelopersGunnar Hillert, Member of Technical Staff, Spring Integration © 2011 SpringSource, A division of VMware. All rights reserved
  • Agenda§  Overview§  Deployment§  Debugging§  Profiling§  Agnostic War Files§  Modular Cloud Apps 2
  • What is Cloud Foundry? 3
  • 4
  • Three Layers of Cloud Computing§  SaaS •  Software as a Service§  PaaS •  Platform as a Service§  IaaS •  Infrastructure as a Service 5
  • Choice of clouds .js Data Services Private     Clouds     …   Msg Services Public   Clouds   .COM Other Micro   Services Clouds   6
  • Broad Support for Languages/Application Frameworks§  JVM •  Spring, Grails, Roo, Lift, plain Java§  Ruby •  Rails, Sinatra§  Node.js§  Community contributions •  Erlang, Python, PHP 7
  • JVM Frameworks§  Unit of deployment: Java WAR files •  Can run any standard War file •  Servlet 2.5 •  Don’t assume particular container§  Spring, Grails, Lift framework •  Auto-reconfiguration goodies 8
  • Services§  Relational database •  Postgres •  MySQL§  Key-value store •  Redis§  Document store •  MongoDB§  Messaging •  RabbitMQ 9
  • Open Source§  Source code available under Apache License v2.0 ••  VCAP ••  Project Website • 10
  • Logical View 11
  • Architecture Architecture 25 Thursday, October 27, 11 12
  • Deployment Options 13
  • Deployment Options§  VMC •  Ruby based command line tool§  SpringSource Tool Suite (STS)§  Grails§  Spring Roo Cloud Foundry Addon§  Cloud Foundry Maven Plugin§  vcap-java-client •  Used by STS and Cloud Foundry Maven Plugin 14
  • DEMODeployment Options 15
  • Debugging 16
  • Debugging§  Start Cloud Foundry applications in debug mode§  Set Break Points for Micro Cloud Foundry§  STS 2.8.1 supports it§  Coming with Micro Cloud Foundry 1.1.1 (Currently RC) 17
  • Caldecott§  TCP over HTTP tunnel§  Local client§  Remote server 18
  • Caldecott - Multiple Services and Sessions§  One vcc server instance •  Manages multiple tunnels§  One vcc client instance per service •  Multiple local apps may share a client if they connect to the same remote server:port •  Each listens on different local port 19
  • DEMODebugging 20
  • Profiling 21
  • Profiling – Spring Insight§  Providing real-time application runtime performance and behavior information for Java Spring applications§  Beta available for§  Signup at:§  Write your own plugins • 22
  • DEMOSpring Insight for Cloud Foundry 23
  • Agnostic War Files 24
  • Agnostic War Files – Toolbox§  Auto Reconfiguration§  Cloud Namespace§  Spring 3.1 Profiles 25
  • Agnostic War Files – Auto Reconfiguration§  Move existing Applications easily to Cloud Foundry§  Makes 2 modifications at deploy time: •  Adds additional Jar •  Updates web.xml§  BeanFactoryPostProcessor examines the application context before creating beans§  Swaps existing beans of matching types 26
  • Agnostic War Files – Auto Reconfiguration Service Type Replaced Bean Type MySQL javax.sql.DataSource Postgres javax.sql.DataSource Redis MongoDB RabbitMQ org.sf.amqp.rabbit.connection.ConnectionFactory 27
  • Agnostic War Files – Auto Reconfiguration§  Limitations •  one service of a given service type •  one bean of the matching type •  If application does not follow limits, auto-reconfiguration mechanism will not take place 28
  • Agnostic War Files – Cloud Namespace§  Explicit configuration of Cloud Foundry Services§  Finer grained control of configuration parameters§  Necessary when configuring multiple services of same type 29
  • Agnostic War Files – Cloud Namespace§  Setup – Maven<dependency> <groupId>org.cloudfoundry</groupId> <artifactId>cloudfoundry-runtime</artifactId> <version>0.8.1</version></dependency>§  Setup – Spring Application Context<?xml version="1.0" encoding="UTF-8"?><beans … xmlns:cloud="" xsi:schemaLocation=“"> 30
  • Available Namespace Elements§  Define and use a DataSource <cloud:data-source id="dataSource" /> <bean id="jdbcTemplate” class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="dataSource" /> </bean>§  Optional Subelements •  <cloud:connection> •  <cloud:pool> 31
  • Available Namespace Elements§  MongoDB Support •  <cloud:mongo-db-factory>§  Redis Support •  <cloud:redis-connection-factory>§  RabbitMQ •  <cloud:rabbit-connection-factory>§  Autocreate Services •  <cloud:service-scan> 32
  • Agnostic War Files – Spring Profiles§  Spring 3.1 adds new support for environments§  Deploy to Cloud Foundry and Stand-alone Containers<bean id="mongoTemplate" class=""> <constructor-arg ref="mongoDbFactory" /></bean><beans profile="default"> <mongo:db-factory id="mongoDbFactory" dbname="pwdtest" host="" port="27017" username="test_user" password=”s3cr3t" /></beans><beans profile="cloud"> <cloud:mongo-db-factory id="mongoDbFactory" /></beans> 33
  • Modular Cloud Apps 34
  • Monolithic Enterprise Application 35
  • Benefits of App-level Modularity§  Efficient Elasticity§  Fault Isolation§  Dynamic Configuration§  “always-on”/Rolling Upgrades 36
  • Modularized Enterprise Application 37
  • DEMOSpring Integration 38
  • Resources 39
  • Resources§  Cloud Foundry on Ubuntu paas.html§  VMC command-line-vmc-users 40
  • Resources§  Cloud Foundry Maven Plugin maven/ plugin (Sources + Reference Documentation)§  Caldecott cloud-foundry-data-service§  Cloud Foundry Samples 41
  • Resources§  Spring Auto Reconfiguration part-2-auto-reconfiguration/§  Spring Insight for Cloud Foundry§  Cloud Foundry Namespace applications-part-3-the-cloud-namespace/§  Spring Profiles part-4-%E2%80%93-spring-profiles/ 42
  • Resources§  Spring Integration§  Samples 43
  • THANK YOU! Sign up for a free account at: ghillert@vmware.comTwitter: 44