Skip to content

a quickstart showing how to use Spring Boot, Apache Camel and Teiid together with Kubernetes or OpenShift

License

Notifications You must be signed in to change notification settings

fabric8-quickstarts/spring-boot-camel-teiid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-Boot Camel-Teiid QuickStart

This example demonstrates how to connect Apache Camel to a remote JBoss Data Virtualization (or Teiid) Server using the JDBC protocol.

In the example, a Camel route periodically generates random categories then executes aggregate queries in the remote Teiid virtual database (VDB), performing different paths depending on the result of each query.

This quickstart assumes that the Teiid server is already running on Openshift (or Kubernetes) with the example Portfolio virtual database deployed. One simple way to run a Teiid server and deploy the Portfolio virtual database is following the documentation of the [JDV xPaaS image for Openshift](https://access.redhat.com/documentation/en-us/red_hat_jboss_data_virtualization/6.4/html/red_hat_jboss_data_virtualization_for_openshift) related to the datavirt64-basic-s2i template.

During the JDV server creation, the username and password fields for the Teiid user should be filled in. The same credentials must be used in this quickstart for the properties teiid.username and teiid.password of the application.properties file. When using the Openshift S2I build mode, the credentials must be provided in the template.

The application utilizes the Spring @ImportResource annotation to load a Camel Context definition via a src/main/resources/spring/camel-context.xml file on the classpath.

Important
This quickstart can run in 2 modes: standalone on your machine and on Kubernetes / OpenShift Cluster

Deployment options

You can run this quickstart in the following modes:

  • Kubernetese / Single-node OpenShift cluster

  • Standalone on your machine

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

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

Running the Quickstart on a single-node Kubernetes/OpenShift cluster

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

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

To deploy this quickstart 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 quickstart:

    $ oc new-project MY_PROJECT_NAME
  4. Change the directory to the folder that contains the extracted quickstart application (for example, my_openshift/spring-boot-camel-teiid) :

    $ cd my_openshift/spring-boot-camel-teiid
  5. Build and deploy the project to the OpenShift cluster:

    $ mvn clean -DskipTests fabric8: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 spring-boot-camel-teiid has started up.

  7. On the project’s Overview page, navigate to the details page deployment of the spring-boot-camel-teiid application: https://OPENSHIFT_IP_ADDR:8443/console/project/MY_PROJECT_NAME/browse/rc/spring-boot-camel-teiid-NUMBER_OF_DEPLOYMENT?tab=details.

  8. Switch to tab Logs and then see the messages sent by Camel.

Running the quickstart standalone on your machine

To run this quickstart 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 service:

    $ mvn spring-boot:run
  4. See the messages sent by Camel.

About

a quickstart showing how to use Spring Boot, Apache Camel and Teiid together with Kubernetes or OpenShift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages