Skip to content

hello-world-msa-demo/file-message-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-Boot Camel Quickstart using REST and reading from file

This example relies on the Fabric8 Maven plugin for its build configuration and uses the fabric8 Java base image.

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:

  • Kubernetes / 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.

Swagger API

The example provides API documentation of the service using Swagger using the context-path camel-rest-sql/api-doc. You can access the API documentation from your Web browser at http://spring-boot-camel-rest-sql-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io/camel-rest-sql/api-doc.

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

Config map

In order to create the config map:

oc create -f ./src/main/resources/configmap.yml

In order to give the right permissions (to read the CM):

oc policy add-role-to-user view system:serviceaccount:PROJECTNAME:default -n PROJECTNAME

Here you can view the props currently loaded:

YOURAPPURL/camel/props

Testing the app

In order to test content based routing, you have to expose the service:

oc expose s2i-spring-boot-camel --port=8080
oc expose service/s2i-spring-boot-camel

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages