Giter Site home page Giter Site logo

yashashree-chopada / spring-boot-camel-amq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fabric8-quickstarts/spring-boot-camel-amq

0.0 0.0 0.0 458 KB

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

License: Apache License 2.0

Java 100.00%

spring-boot-camel-amq's Introduction

Spring-Boot, Camel and EnMasse QuickStart

This quickstart demonstrates how to connect a Spring-Boot application to EnMasse (MaaS) and use JMS messaging between two Camel routes using Kubernetes or OpenShift.

In this example we will use two containers, one container to run as an EnMasse instance, and another as a client to the broker, where the Camel routes are running.

This quickstart requires EnMasse to have been deployed and running first. To install EnMasse into OpenShift or Kubernetes follow documentation.

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-amq) :

    $ cd my_openshift/spring-boot-camel-amq
  5. Before running the quickstart, you need to configure EnMasse (create user and queue - both as an admin). Run the following commands to apply configuration files:

    $ oc login -u system:admin
    $ oc apply -f src/main/resources/k8s
  6. Build and deploy the project to the OpenShift cluster:

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

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

  9. 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. You need to have a running instance of EnMasse with messaging user admin:test and queue incomingOrders.

    You can use EnMasse instance from previous steps. You need to configure the src/main/resources/application.properties file in order to use the correct remote instance of EnMasse.

    Get remote url of EnMasse instance by running the following command:

    $ oc get addressspace spring-boot-camel-amq -o jsonpath={.status.endpointStatuses[?(@.name==\'messaging\')].externalHost}

    Fill this value into src/main/resources/application.properties instead of FILL_ME.

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

  3. Build the project:

    $ cd PROJECT_DIR
    $ mvn clean package
  4. Run the service:

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

spring-boot-camel-amq's People

Contributors

apupier avatar astefanutti avatar chirino avatar dhirajsb avatar fusesource-ci avatar jamesnetherton avatar jiriondrusek avatar johnpoth avatar jstrachan avatar lburgazzoli avatar nicolaferraro avatar rawlingsj avatar rhuss avatar valdar 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.