Java Magazine, Mar/Apr 2018
ORACLE COM JAVAMAGAZINE MARCH APRIL 2018 89 reactive programming Listing 5 Using curl to access the endpoint as jlong curl ujlong pw http localhost 8080 books jlong It wont work if I try to access http localhost 8080 books rwinch as I do in Listing 6 Only ADMIN role users can access other endpoints Listing 6 Using curl to access the endpoint as rwinch curl urwinch pw http localhost 8080 books Deployment The application is secure and observable Now I can deploy it This kind of app is a natural thing to run in a cloud provider such as Cloud Foundry an open source cloud platform released under version 20 of the Apache License which is optimized for the continuous management of applications It sits at a level or two above cloud infrastructure It is infrastructure agnostic running on local cloud providers such as OpenStack and vSphere and on public cloud providers such as Amazon Web Services Google Cloud Microsoft Azure and Oracle Cloud No matter where Cloud Foundry is installed its use is basically the same You authenticate and then tell the platform about your application workload using the cf command line interface CLI and the cf push command as shown in Listing 7 Listing 7 Using the cf CLI to push the application cf login a CF_ API_ ENDPOINT u CF_ USER s CF_ SPACE o CF_ ORG cf push p library service 001 SNAPSHOT jar java magazine library service Once the application is up and running you can access its public HTTP endpoints You can provision backing services such as message queues databases and caches using cf createservice You can scale the application up to multiple load balanced instances by using cf scale You can interrogate the applications metrics its Spring Boot Actuator endpoints its health and much more all from the Pivotal Apps Manager dashboard The application is up and running now and the clients can talk to it in a secure fashion Lets look at that client
You must have JavaScript enabled to view digital editions.