/camel-rabbitmq-poc

proof of concept for camel-rabbitmq using spring-boot and cloudevents headers

Primary LanguageJava

camel-rabbitmq-poc

proof of concept for camel-rabbitmq using camel-rest for exposing rabbitmq routes.

run rabbitmq locally

$ cd rabbitmq
$ docker build -t my-rabbit .
$ docker run -it --rm --name rabbitmq -p 5672:5672 -p 15672:15672 my-rabbit:latest

run application

$ mvn clean package
$ java -jar target/camel-rabbitmq-poc-0.0.1-SNAPSHOT.jar 

test with POST

$ curl -X POST localhost:8080/api/event -d '{"key1":"value1", "key2":"value2"}' -H 'Content-type: application/json'

expected output

{
    "key1" : "value1",
    "key2" : "value2"
}

expected logs

publishEventDirectRoute                  : Publishing event {key1=value1, key2=value2}
org.apache.qpid.jms.JmsConnection        : Connection ID:3... connected to server: rabbitmq://localhost:5672
route1                                   : Message received {key1=value1, key2=value2}