Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gastaldi/natural-side
Generated by the Red Hat Developer Launcher (https://developers.redhat.com/launch)
https://github.com/gastaldi/natural-side
Last synced: 5 days ago
JSON representation
Generated by the Red Hat Developer Launcher (https://developers.redhat.com/launch)
- Host: GitHub
- URL: https://github.com/gastaldi/natural-side
- Owner: gastaldi
- License: apache-2.0
- Created: 2019-07-10T02:21:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-10T02:21:16.000Z (over 5 years ago)
- Last Synced: 2024-11-08T09:47:37.193Z (about 2 months ago)
- Language: HTML
- Homepage:
- Size: 171 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= Cache - Thorntail Example Application
[IMPORTANT]
====
While you can run and interact with this example application on localhost, it requires that you also have a cache server installed and configured. This example application runs best when deployed on OpenShift with a JBoss Data Grid cache server.
For more details on using this example application with a single-node OpenShift cluster, CI/CD deployments, as well as the rest of the runtime, see the link:http://launcher.fabric8.io/docs/thorntail-runtime.html[Thorntail Runtime Guide].
====IMPORTANT: This example application requires Java 8 JDK or greater and Maven 3.3.x.
IMPORTANT: As part of the process of creating this example application using developers.redhat.com/launch or the Fabric8 Launcher tool, set up a project with a CI/CD deployment of this example application. You can see the status of this deployment in your Single-node OpenShift Cluster or OpenShift Online Web Console.
== Running the Example Application on a Single-node OpenShift Cluster
If you have a single-node OpenShift cluster, such as Minishift or Red Hat Container Development Kit, link:http://launcher.fabric8.io/docs/minishift-installation.html[installed and running], you can also deploy your example application there. A single-node OpenShift cluster provides you with access to a cloud environment that is similar to a production environment.To deploy your example application to a running single-node OpenShift cluster:
. Navigate to the root directory of your example application.
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ git clone [email protected]:gastaldi/natural-side$ cd natural-side
----. Log in and create your project.
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc login -u developer -p developer$ oc new-project MY_PROJECT_NAME
----. Deploy the cache service.
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc create -f service.cache.yml
----. Deploy your example application.
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ mvn clean fabric8:deploy -Popenshift
----== Interacting with the Example Application on a Single-node OpenShift Cluster
. Determine the URL of the `greeting` service.
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc get route ${value-name-app} -o jsonpath={$.spec.host}${value-name-app}-MY_PROJECT_NAME.LOCAL_OPENSHIFT_HOSTNAME
----. Navigate to the `greeting` service using your browser.
. Click _Invoke the service_ once.
+
Notice the `duration` value is above `2000`. Also notice the cache state has changed form `No cached value` to `A value is cached`.. Wait 5 seconds and notice cache state has changed back to `No cached value`.
+
The TTL for the cached value is set to 5 seconds.
Once the TTL expires, the value is no longer cached.. Click _Invoke the service_ once more to cache the value.
. Click _Invoke the service_ a few more times over the course of a few seconds while cache state is `A value is cached`.
+
Notice a significantly lower `duration` value since it is using a cached value.
If you click _Clear the cache_, the cache is emptied.== More Information
You can learn more about this example application and the Thorntail runtime in the link:http://launcher.fabric8.io/docs/thorntail-runtime.html[Thorntail Runtime Guide].NOTE: Run the set of integration tests included with this example application using `mvn clean verify -Popenshift,openshift-it`.