GithubHelp home page GithubHelp logo

salesforcetest's Introduction

Externalized Configuration - Fuse Booster

Overview

The Externalized Configuration mission provides a basic example of using a ConfigMap (or a properties file in the case of standalone deployments) to externalize configuration used in an Apache Camel route. A ConfigMap is an object that you can use to inject configuration data (in simple key and value pair format) into one or more Linux containers.

This booster exposes a simple api/greetings/ service that produces a response based on a configuration property in JSON format of the form {"greetings":"Hello, default"}. When the value changes, the service’s response changes.

Deployment options

You can run this booster in the following modes:

  • Single-node OpenShift cluster

  • OpenShift Online at https://developers.redhat.com/launch

  • Standalone on your machine (note that, in this mode, the configuration uses an application.properties file instead of a ConfigMap)

The most effective way to use this booster is to deploy and run the project on OpenShift.

For more details about running this booster on a single-node OpenShift cluster, CI/CD deployments, as well as the rest of the runtime, see the Spring Boot Runtime Guide.

Important
This booster requires Java 8 JDK or later and Maven 3.3.x or later.

Running the booster on a single-node OpenShift cluster

A single-node OpenShift cluster provides you with access to a cloud environment that is similar to a production environment.

If you have a single-node OpenShift cluster, such as Minishift or the Red Hat Container Development Kit, installed and running, you can deploy your booster there.

To deploy this booster to a running single-node OpenShift cluster:

  1. Download the project and extract the archive on your local filesystem.

  2. Log in to your OpenShift cluster:

    $ oc login -u developer -p developer
  3. Create a new OpenShift project for the booster:

    $ oc new-project MY_PROJECT_NAME
  4. Change the directory to the folder that contains the extracted booster application (for example, my_openshift/fuse-configmap-booster) :

    $ cd my_openshift/fuse-configmap-booster
  5. Build and deploy the project to the OpenShift cluster:

    $ mvn clean -DskipTests oc:deploy -Popenshift
  6. In your browser, navigate to the MY_PROJECT_NAME project in the OpenShift console. Wait until you can see that the pod for the fuse-configmap-booster application has started up.

  7. On the project’s Overview page, locate the URL for the fuse-configmap-booster application. The URL uses this form: http://fuse-configmap-booster-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io.

  8. Click the URL to access the Greeting Service application and then follow the instructions on that page.

Running the booster on a single-node OpenShift cluster without preinstalled images

To deploy your booster to a running single-node OpenShift cluster without preinstalled images:

  1. Download the project and extract the archive on your local filesystem.

  2. Log in to your OpenShift cluster:

    $ oc login -u developer -p developer
  3. Create a new OpenShift project for the booster:

    $ oc new-project MY_PROJECT_NAME
  4. Import base images in your newly created project (MY_PROJECT_NAME):

    $ oc import-image fuse-java-openshift-rhel8:1.11 --from=registry.access.redhat.com/fuse7/fuse-java-openshift-rhel8:1.11 --confirm
  5. Change the directory to the folder that contains the extracted booster application (for example, my_openshift/fuse-configmap-booster) :

    $ cd my_openshift/fuse-configmap-booster
  6. Build and deploy the project to the OpenShift cluster:

    $ mvn clean -DskipTests oc:deploy -Popenshift -Djkube.generator.fromMode=istag -Djkube.generator.from=MY_PROJECT_NAME/fuse-java-openshift-rhel8:1.11
  7. In your browser, navigate to the MY_PROJECT_NAME project in the OpenShift console. Wait until you can see that the pod for the fuse-configmap-booster application has started up.

  8. On the project’s Overview page, locate the URL for the fuse-configmap-booster application. The URL uses this form: http://fuse-configmap-booster-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io.

  9. Click the URL to access the Greeting Service application and then follow the instructions on that page.

Running the booster on OpenShift Online

To deploy this booster directly to OpenShift Online when you create the project at https://developers.redhat.com/launch:

  1. Go to https://developers.redhat.com/launch.

  2. At the Deployment step, select Use OpenShift Online.

  3. Follow the on-screen instructions to create a new Externalized Configuration project by using the Fuse runtime.

Note
As part of the process of creating this booster, https://developers.redhat.com/launch sets up a project with a CI/CD deployment of this booster. You can see the status of this deployment in your single-node OpenShift cluster or OpenShift Online web console.

Running the booster standalone on your machine

To run this booster as a standalone project on your local machine:

  1. Download the project and extract the archive on your local filesystem.

  2. Build the project:

    $ cd PROJECT_DIR
    $ mvn clean package
  3. Run the services:

    $ mvn spring-boot:run
  4. Go to http://localhost:8080 and then follow the instructions on that page.

salesforcetest's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.