https://github.com/pwright/evals07-tutoria-691f
Generated by Red Hat Developer Launch (https://launcher-launcher.apps.lrossett-3c59.openshiftworkshop.com)
https://github.com/pwright/evals07-tutoria-691f
Last synced: 8 months ago
JSON representation
Generated by Red Hat Developer Launch (https://launcher-launcher.apps.lrossett-3c59.openshiftworkshop.com)
- Host: GitHub
- URL: https://github.com/pwright/evals07-tutoria-691f
- Owner: pwright
- License: apache-2.0
- Created: 2019-05-13T13:56:22.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-13T13:56:26.000Z (about 7 years ago)
- Last Synced: 2025-06-04T01:15:31.900Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
:launchURL: https://developers.redhat.com/launch
= Fuse Aggregation
The booster demonstrates how to aggregate JSON data from 2 services using Camel.
Use this booster to:
* Execute an HTTP GET request on the `camel/flights` endpoint to retrieve a list of flights (arrivals and departures). Arrivals and Departures are aggregated from 2 separate services. See `CamelRouter.java` for how these 2 services are aggregated.
These services are configured to be local service beans by default. However, you can change the camel routing to fetch data from 2 mock servers (included in this booster).
* Browse the API's Swagger page.
== Deployment options
You can run this booster in the following modes:
* Single-node OpenShift cluster
* OpenShift Online at link:{launchURL}[]
* Standalone on your machine
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 link:http://appdev.openshift.io/docs/spring-boot-runtime.html[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, link:http://appdev.openshift.io/docs/minishift-installation.html[installed and running], you can deploy your booster there.
To deploy this booster to a running single-node OpenShift cluster:
. Download the project and extract the archive on your local filesystem.
. Log in to your OpenShift cluster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc login -u developer -p developer
----
. Create a new OpenShift project for the booster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc new-project MY_PROJECT_NAME
----
. Change the directory to the folder that contains the extracted booster application (for example, `my_openshift/fuse-rest-http-booster`) :
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ cd my_openshift/fuse-rest-http-booster
----
. Build and deploy the project to the OpenShift cluster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ mvn clean -DskipTests fabric8:deploy -Popenshift
----
. 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-rest-http-booster` application has started up.
. On the project's `Overview` page, locate the URL for the `fuse-flights-aggregator` application. The URL uses this form:
`http://fuse-flights-aggregator-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io`.
. Click the URL to access the Flights Service 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 link:{launchURL}[].
. Go to link:{launchURL}[].
. At the *Deployment step*, select *Use OpenShift Online*.
. Follow the on-screen instructions to create a new *REST API Level 0* project by using the *Fuse* runtime.
NOTE: As part of the process of creating this booster, link:{launchURL}[] 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:
. Download the project and extract the archive on your local filesystem.
. Build the project:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ cd PROJECT_DIR
$ mvn clean package
----
. Run the services:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ mvn spring-boot:run
----
. Go to link:http://localhost:8080[] and then follow the instructions on that page.