Vikram
Vikram

Reputation: 11

Rabbitmq spring java configuration with apache RouteBuilder

I want to configure spring boot application with rabbitmq and apache RouteBuilder, can any one suggest me how to do that

Upvotes: 0

Views: 80

Answers (1)

code4f
code4f

Reputation: 1141

Do you mention Apache camel RouteBuiler? If you say yes, you can use RabbitMQ component that provided by Apache camel since version 2.12. For more detail, please check my sample code:

<!-- language: lang-java -->

@Component
public class MyRoute extends RouteBuilder {
    @Override
    public void configure() throws Exception {
    // listen from exchange and log to console
        from("rabbitmq:topic_logs2?" +
            "vhost=myvhost&hostname=localhost&portNumber=5672" +
            "&username=myname&password=mypassword" +
            "&exchangeType=topic&autoDelete=false&queue=my_queue&routingKey=test.log")
        .log("From RabbitMQ: ${body}");
    }
}

Upvotes: 3

Related Questions