Using Oracle 12c with Pivotal Cloud Foundry Applications

In this post I walk through what it would take to access Oracle 12c using a spring boot application deployed to Pivotal Cloud Foundry PCF all from my Macbook Pro. Of course this can be done outside of an isolated laptop like my Macbook Pro but handy while doing DEV/TEST and still being able to use Oracle 12c.

Requirements
  • Oracle 12c instance
  • PCFDev 
  • Git Client

1. First you will need a 12c Database and the (more...)

Using H2 Console in development with Spring Boot then NOT when deployed to Pivotal Cloud Foundry

Frequently when developing Spring based applications, I will use the H2 in memory database during your development process. H2 ships with a web based database console, which you can use while your application is under development. It is a convenient way to view the tables created by Hibernate and run queries against the in memory database. In this post I show what is required to set this up as well as what it means to (more...)

Spring Boot on Google Cloud Platform (GCP)

I recently created a demo which can be used to deploy a basic Spring Boot application on Google Cloud Platform (GCP). There isn't really anything specific in the code to make this work on GCP BUT the maven pom.xml has what is required to make it one simple command to send this app to GCP.

$ mvn gcloud:deploy

You can run an App Engine application in two environments, the standard environment and the flexible (more...)

Pivotal MySQL*Web – Web Based Spring Boot / Bootstrap Application for Pivotal MySQL tile (p-mysql)

I have been recently working on a web based interface to Pivotal MySQL Tile which can be deployed to Pivotal Cloud Foundry and bound to a p-mysql service instance for instant access to the MySQL DB. Known as PivotalMySQL*Web this is a browser based SQL tool rendered using Bootstrap UI for MySQL PCF service instances which allows you to run SQL commands and view schema objects from a browser based interface. It includes the following (more...)

JHipster, Spring Boot, AngularJS and finally deployed to Pivotal Cloud Foundry

I have known about Hipster for a while and thought I would finally give it a test drive and deploy a simple scaffolded app to Pivotal Cloud Foundry. In this post I will use the p-mysql (Pivotal MySQL) rather then the ClearDB instance



1. I created a very basic "Monolithic" application as shown below.

pasapicella@pas-macbook:~/pivotal/software/jhipster/apps/employee-mysql-jhipster$ yo jhipster

.....

                            http://jhipster.github. (more...)

Variable substitution for a manifest.yml for Cloud Foundry

Pushed applications to CF or PCF you would of most likely used a manifest.yml file and at some point wanted to use variable substitution. manifest.yml files don't support that and a feature request has been asked for this as follows

https://github.com/cloudfoundry/cli/issues/820

With a recent customer we scripted the creation of a manifest.yml file from a Jenkins job  which would inject the required ROUTE to the application by creating the manifest.yml (more...)

HttpSessionListener with Spring Boot Application

I had a requirement to implement a HttpSessionListener in my Spring Boot application which has no web.xml. To achieve this I did the following

1. My HttpSessionListener was defined as follows
 
package com.pivotal.pcf.mysqlweb.utils;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import org.apache.log4j.Logger;

public class SessionListener implements HttpSessionListener
{
protected static Logger logger = Logger.getLogger("controller");
private HttpSession session = null;

public (more...)

Simple Spring Boot Application Deployed through Concourse UI to Pivotal Cloud Foundry

The demo below is a full working example of using Spring Boot Application which will build/deploy to Pivotal Cloud Foundry using Concourse. Concourse pipelines can easily be created within your source code as this demo shows and hence created / executed quite easily. Concourse limits itself to three core concepts: tasks, resources, and the jobs that compose them.

https://github.com/papicella/SpringBootSimpleRest

Detailed instructions on how to setup/run this demo using Concourse see the link referenced above (more...)

PCFDev application accessing an Oracle 11g RDBMS

PCF Dev is a small footprint distribution of Pivotal Cloud Foundry (PCF) intended to be run locally on a developer machine. It delivers the essential elements of the Pivotal Cloud Foundry experience quickly through a condensed set of components. PCF Dev is ideally suited to developers wanting to explore or evaluate PCF, or those already actively building cloud native applications to be run on PCF. Working with PCF Dev, developers can experience the power of (more...)

Telstra WIFI API Consumer on Pivotal Cloud Foundry

If you heard of Telstra WIFI API you will know it will allow you to search for WIFI Hotspots within a given radius and can be used after signing in for Telstra.dev account at https://dev.telstra.com/ to obtain the Hotpots within a given Radius and Lat/Long location.

The WIFI API for Telstra is described at the link below.

  https://dev.telstra.com/content/wifi-api

The following application I built on Pivotal Cloud Foundry consumes this (more...)

Billing/Metering on Pivotal Cloud Foundry using the Usage Service API’s

Pivotal Cloud Foundry (PCF) provides a REST API to provide billing/metering data for application and service usage. Although this usage can we viewed in the applications manager dashboard UI in this post below we will show how to use the REST based API using PCF 1.7.

Below we will show how to use the cf CLI to retrieve information about your app and service instances via the Cloud Controller and Usage service APIs.

Obtain (more...)

Creating a Service within IntelliJ IDEA to be used by the Service Registry for Pivotal Cloud Foundry

In this example I am going to show how to use IntelliJ IDEA 15 to create a service application from the IDE to be consumed by the Service Registry service in Pivotal Cloud Foundry (PCF). For more information on this service view the docs page below.

http://docs.pivotal.io/spring-cloud-services/service-registry/index.html

Service Registry for Pivotal Cloud Foundry® (PCF) provides your applications with an implementation of the Service Discovery pattern, one of the key tenets of a (more...)

Pivotal Cloud Foundry Spring Boot JPA demo written in Kotlin

I created the following demo for PCF using spring boot / PCF. After showing a colleague he decided he would write a Kotlin version of the same application. It's interesting to see how the Kotlin classes differ to those of Java.

https://github.com/papicella/PivotalSpringBootJPA

The Kotlin version of the same application is here.

https://github.com/papicella/Kotlin-PivotalSpringBootJPA

Kotlin is a functional language developed by the JetBrains guys. Its main benefits are:

  • Conciseness of code
  • Code safety - Null (more...)

Integrating Telstra SMS API with the Apigee Edge Service Broker for Pivotal Cloud Foundry (PCF)

Apigee and Pivotal partnered to provide comprehensive API management capabilities that expedite the scalable delivery of apps on the powerful Pivotal Cloud Foundry platform. Apigee Edge is available for rapid deployment as a partner service in the Pivotal Network

The following link talks about this service in detail

http://apigee.com/about/solutions/pivotal-cloud-foundry-apigee

In this blog post we walk through how we would use this Service on Pivotal Cloud Foundry 1.7 to expose Telstra SMS Api.


1. (more...)

IBM Bluemix Liberty Buildpack and Spring Boot Applications for "Auto-Scale" and "Monitoring" Services

Working with a customer last week we determined that Spring Boot applications using Liberty Buildpack failed to allow the "Auto-Scale" service to show up "Throughput" metrics and essentially mean we couldn't scale out or down application instances using Throughput metrics.

https://console.ng.bluemix.net/docs/runtimes/liberty/index.html

It turns out the Agent within the IBM Liberty buildpack isn't quite picking up application WAR files created using Spring Boot and hence "Monitoring and Analytics" and " (more...)

IBM Bluemix Dedicated/Local Status Page

With Bluemix Public you can view the status page which details all the runtimes and services and thier current status on all 3 PUBLIC regions. Those customers with Bluemix Dedicated or Local get a status page which includes a column on the status of thier Dedicated or Local instance.

To navigate to it perform the following steps:

1. Log into your Bluemix dedicated or local instance web console

2. Click on the Status link which (more...)

Telstra SMS API Swagger Enabled and deployable on Bluemix Sydney Public Instance

The following demo below can be used to expose the Telstra SMS Public API https://dev.telstra.com/content/sms-api-0

https://github.com/papicella/TelstraSMSAPIPublic

You can deploy this to Bluemix by simply using the "Deploy to Bluemix" button as shown below.


Once deployed you have a Swagger UI enabled REST endpoints to consume as shown below.

Application once deployed on Bluemix


Swagger UI 



More Information

https://dev.telstra.com/content/sms-api-0
http://bluemix.net


Taking IBM Bluemix OpenWhisk for a Test Drive


OpenWhisk is a new event-driven platform that lets developers quickly and easily build feature-rich apps that automatically trigger responses to events. To read more about it view the link below. In this simple example we will explore it it's use from IBM Bluemix by returning Todays date.

https://developer.ibm.com/open/openwhisk/

Steps

1. Login to Bluemix using http://bluemix.net

2. Click on "Try OpenWhisk" as shown below


3. Once logged in to the new (more...)

Tomcat Runtime added to Web Console of IBM Bluemix

I almost always use the tomcat buildpack within IBM Bluemix for my Java based applications. By default IBM bluemix will use the IBM Liberty buildpack for java apps unless you specify otherwise. The buildpacks on Bluemix can be viewed using "cf buildpacks" and the tomcat buildpack is referred to as "java_buildpack"

So to use the tomcat buildpack in a manifest.yml you would target it as follows

applications:
- name: pas-javaapp
(more...)

IBM Bluemix NodeRed Demo using Twitter and Telstra SMS API

In this example I integrate Twitter Feed with Telstra SMS API to send an SMS based. It is based on the wrapper application which exposes the Telstra SMS API on Bluemix as per a previous Post.

http://theblasfrompas.blogspot.com.au/2015/08/integrating-telstra-public-sms-api-into.html

It is assumed you have NodeRed NodeJS application running on Bluemix and are at the Editor as shown below.



Steps

1. Drag a "Social -> Twitter" node onto the editor
2. Double (more...)