Embedded AMQP Java Broker

前端 未结 5 551
無奈伤痛
無奈伤痛 2021-01-31 10:38

I am trying to create integration test for a Scala / Java application that connects to a RabbitMQ broker. To achieve this I would like an embedded broker that speaks AMQP that I

5条回答
  •  情歌与酒
    2021-01-31 11:16

    I've developed a wrapper around the process of downloading, extracting, starting and managing RabbitMQ so it can work like an embedded service controlled by any JVM project.

    Check it out: https://github.com/AlejandroRivera/embedded-rabbitmq

    It's as simple as:

    EmbeddedRabbitMqConfig config = new EmbeddedRabbitMqConfig.Builder()
        .version(PredefinedVersion.V3_5_7)
        .build();
    EmbeddedRabbitMq rabbitMq = new EmbeddedRabbitMq(config);
    rabbitMq.start();
    ...
    rabbitMq.stop();
    

    Works on Linux, Mac and Windows.

提交回复
热议问题