tree: d0c07edeeb2091f507cb4afd1c0c6d9b65bfe321 [path history] [tgz]
  1. artemis/
  2. amqp.groovy
  3. amqp.js
  4. amqp.properties
  5. AmqpConnectionBeanConsumer.java
  6. AmqpConnectionBeanProducer.java
  7. README.md
generic-examples/amqp/README.md

AMQP Camel K examples

These examples demonstrate how to use AMQP in a Camel K integration.

You can find more information about Apache Camel and Apache Camel K on the official Camel website.

Before you begin

Read the general instructions in the root README.md file for setting up your environment and the Kubernetes cluster before looking at this example.

Make sure you've read the installation instructions for your specific cluster before starting the example.

Additional Requirements for running this example

An AMQP Broker: needed MoM for running the examples. For installation instructions, see how to install a JMS/AMQP Broker on Kubernetes for demo purposes.

Understanding the Example

Running the Example

You should have an amqp broker running in a namespace, if not, see how to install a JMS/AMQP Broker on Kubernetes

To create a secret for your credentials, run:

kubectl create secret generic my-amqp --from-file=amqp.properties

To run an integration that sends message to amqp queue, run:

kamel run AmqpConnectionBeanProducer.java --config secret:my-amqp

To consume messages from the amqp queue, run:

kamel run AmqpConnectionBeanConsumer.java --dev --config secret:my-amqp

The terminal should show the logged messages:

[1] 2022-06-21 15:44:46,513 INFO  [info] (Camel (camel-1) thread #1 - JmsConsumer[example]) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K]
[1] 2022-06-21 15:44:47,513 INFO  [info] (Camel (camel-1) thread #1 - JmsConsumer[example]) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K]
[1] 2022-06-21 15:44:48,517 INFO  [info] (Camel (camel-1) thread #1 - JmsConsumer[example]) Exchange[ExchangePattern: InOnly, BodyType: String, Body: Hello Camel K]