I rarely need to save state within the Servlet Context via an application scope, but recently I did and here is what your controller class would look like to get access to the ServletConext with Spring. I was using Spring Boot 1.3.2.RELEASE.
In short you implement the "org.springframework.web.context.ServletContextAware" interface as shown below. In this example we retrieve an application scope attribute.
There is now a new command line plugin for IBM containers on Bluemix so you can push and run docker images using CF CLI itself. The steps below show you how to set this up and I use a basic spring boot application as a docker image to test this out.
Take a note of the docker local host IP. In this example it was as follows, as I test my docker image on my laptop prior to pushing it to Bluemix.
-> docker is configured to use the default machine with IP 192.168.99.100
1. Install the latest CF command line, I used the following version.
I created this simple step by step guide on how to use the IBM Secure Gateway Service. Very simple demo which shows how easy it is to set this up and open a world of possibilities from on premise resources directly exposed via Bluemix whether it's PUBLIC or Dedicated/LOcal Instances
The IBM Bluemix Dedicated/Local Administration Console also includes support for CLI to enable common management tasks to be performed using the Cloud Foundry Command Line by adding a plugin to enable support for it's commands.
Note: The Bluemix Admin CLI plugin requires version 6.11.2 or later.
Here is the updated demo with Bootstrap added to the UI pages. You can deploy this to Bluemix using the "Deploy to Bluemix" directly from GitHub and it will as you to Sing into IBM devOps prior to deploying it directly into your Bluemix Environment.
I am more often then not using spring boot applications on IBM Bluemix and most of what I need is packaged with the application from JPA or JDBC, drivers, Rest etc. Of course with IBM Bluemix we can specify which build pack we wish to use but by default for java applications LIberty is used.
When a stand-alone application is deployed, a default Liberty configuration is provided for the application. The default configuration enables the following Liberty features:
If the application requires backing services they can automatically be created using the"declared-services" tag as shown below. Declared services are a manifest extension, which creates or looks for the required or optional services that
Not before time I finally added my first "Deploy to Bluemix" button on my GitHub projects for Bluemix applications. The screen shot below shows this for the Spring Session - Spring Boot Portable Cloud Ready HTTP Session demo.
The demo below is a simple Spring Boot / Thymeleaf/ Bootstrap application to test Session replication using Spring Session - Spring Boot within IBM Bluemix. Same demo will run on Pivotal Cloud Foundry as well.
In the post below I will show how I integrated Telstra public SMS Api into my Bluemix catalog to be consumed as a service. This was all done from Public Bluemix using the Cloud Integration Service. Step 1 - Create a T.DEV account
In order to get started you need to create an account on http://dev.telstra.com in order to be granted access to the SMS API. Once access is granted you need to create an application which enables you to add/manage Telstra API keys as shown below.
Just upgraded to to Intellij IDEA 14.1.4 and found that the Spring Initializr web page for quickly creating spring boot applications has been added to the New Project dialog. The web site I normally drive new spring boot applications from as follows, is now part of IntelliJ IDEA which is great. http://start.spring.io/
The latest Liberty biuldpack update now adds the ability to switch to JRE 1.8 runtime. Given I am now switching to JDK 1.8 for all my projects this has come in very handy, and of course Spring Boot favors JDK 1.8 as well. The default is still JRE 1.7 so to switch to 1.8 set an ENV variable as follows in your manifest.yml as shown below.
I decided to test out the Auto Scale service in IBM Bluemix following this example which shows how to also use the Blazemeter service to Load test the application to simulate extra memory requirement on the application.
The following Buildpack created by an Internal IBM employee streamlines the process of deployment and avoids the need for ENV variables with the pushed application, here;s how. It's also detailed in the GitHub buildpack URL below.
In this post I show what is necessary to deploy a simple Meteor application to IBM Bluemix public instance. In this example we already have a simple Meteor application we have tested and verified using "meteor" itself , running on localhost at port 3000.
1. Lets remove the local DB files, be careful as this will remove the local DB so you should do this when your ready to deploy to Bluemix only.
The IBM Watson Personality Insights service uses linguistic analysis to extract cognitive and social characteristics from input text such as email, text messages, tweets, forum posts, and more. By deriving cognitive and social preferences, the service helps users to understand, connect to, and communicate with other people on a more personalized level.
1. Clone the GitHub repo as shown below.
pas@192-168-1-4:~/bluemix-apps/watson$ git clone https://github.com/watson-developer-cloud/personality-insights-nodejs.git Cloning into
The following shows how you can easily read the VCAP_SERVICES postgresql credentials within your Java Code using the maven repo. This assumes your using the ElephantSQL Postgresql service. A single connection won't be ideal but for demo purposes might just be all you need.
1. First add the maven dependency as follows. This will add WebSphere Application Server Liberty Profile to your project
We recently upgraded our capability in the IBM public cloud. Before this new version you could build, test, and deploy apps on Bluemix by using open source Cloud Foundry technology. But now you have more choice bringing two new options as follows
1. IBM Containers Beta
Use IBM Containers to run apps and services in a hosted cloud environment. Port your existing applications to IBM Bluemix and make them publicly accessible and composable. Use a private registry to upload, store, and retrieve your trusted images.
IBM Bluemix is an open-standards, cloud-based platform for building, managing, and running apps of all types, such as web, mobile, big data, and smart devices. Capabilities include Java, mobile back-end development, and application monitoring, as well as features from ecosystem partners and open source—all provided as-a-service in the cloud.
I recently setup verbose GC logging on a deployed application to Pivotal Cloud Foundry (PCF) and specified a file to write the GC logging info to. Below shows how you can view application files using the CF CLI.
1. Start by invoking the following to show your deployed applications
Here are the steps to deploy a scala play framework application created using Typesafe activator. I created a basic hello world scala application with the play framework. The purpose here is what is needed to get it deployed on Pivotal Cloud Foundry.
The example below shows how to use STS (Spring Tool Suite) to deploy a spring boot web application directly from the IDE itself. I created a basic spring boot web application using the template engine thymeleaf. The application isn't that fancy it simply displays a products page of some mock up Products. This blog entry just shows how you could deploy this to Pivotal Cloud Foundry from the IDE itself.
Pivotal HD for Pivotal CF deliver's Pivotal HD - Pivotal's leading Hadoop distribution as a Pivotal CF Service. Pivotal HD is a commercially supported distribution of Apache Hadoop. The Pivotal HD Data Service includes HDFS, YARN and MapReduce. It also includes HAWQ, Pivotal's high performance SQL database on HDFS and Pivotal's In-memory OLTP SQL processing engine GemFire XD.
The example below shows how you can start a Pivotal GemFireXD distributed system from IntelliJ IDEA. Here we will start a Locator which has Pulse enabled as well as one member. We use the following class method to achieve this from an IDE such as IntelliJ
I am going to show how you would create a WebLogic data source to Pivotal GemFireXD 1.3. In this example I am using the developer edition of Weblogic which known as "Free Oracle WebLogic Server 12c (12.1.3) Zip Distribution and Installers for Developers" You can download / configure it as follows.
The Pivotal Ops Metrics tool is a JMX extension for Elastic Runtime. Pivotal Ops Metrics collects and exposes system data from Cloud Foundry components via a JMX endpoint. Use this system data to monitor your installation and assist in troubleshooting. Below is the tile once installed and available with Pivotal Cloud Foundry Ops Manager
Spring XD is a unified, distributed, and extensible system for data ingestion, real time analytics, batch processing, and data export. The project's goal is to simplify the development of big data applications.
With the introduction of Pivotal GemFire 8 developers can easily incorporate starting/stopping GemFire Locators/Servers directly within Java code allowing them to easily integrate GemFire management within their IDE. This ensures developers can develop/test/run GemFire applications all within their IDE of choice making them much more productive using very simple Launcher API's
I previously blogged on how to create a variable JDBC IN list with Oracle. Here is how you would do it with Pivotal Greenplum. Much easier , without having to write a function. In the Greenplum demo below we use the any function combined with string_to_array