All Projects → fridujo → Rabbitmq Mock

fridujo / Rabbitmq Mock

Licence: apache-2.0
Mock for RabbitMQ Java amqp-client

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rabbitmq Mock

Yii Queue
Queue extension for Yii 3.0
Stars: ✭ 38 (-66.67%)
Mutual labels:  rabbitmq, amqp
Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (-1.75%)
Mutual labels:  rabbitmq, amqp
Tackle
💯 percent reliable microservice communication
Stars: ✭ 44 (-61.4%)
Mutual labels:  rabbitmq, amqp
Spring Boot Rabbitmq
Spring Boot集成rabbitMQ实现消息推送
Stars: ✭ 24 (-78.95%)
Mutual labels:  rabbitmq, amqp
Rabbitroutine
Lightweight library that handles RabbitMQ auto-reconnect and publishing retry routine for you.
Stars: ✭ 77 (-32.46%)
Mutual labels:  rabbitmq, amqp
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-78.95%)
Mutual labels:  rabbitmq, amqp
Rabbitmqbundle
RabbitMQ Bundle for the Symfony2 web framework
Stars: ✭ 1,125 (+886.84%)
Mutual labels:  rabbitmq, amqp
Servicebus
Simple service bus for sending events between processes using amqp.
Stars: ✭ 415 (+264.04%)
Mutual labels:  rabbitmq, amqp
Laravel Queue Rabbitmq
RabbitMQ driver for Laravel Queue. Supports Laravel Horizon.
Stars: ✭ 1,175 (+930.7%)
Mutual labels:  rabbitmq, amqp
Humusamqp
PHP 7 AMQP library
Stars: ✭ 70 (-38.6%)
Mutual labels:  rabbitmq, amqp
Node Celery
Celery client for Node.js
Stars: ✭ 648 (+468.42%)
Mutual labels:  rabbitmq, amqp
Rabbus
A tiny wrapper over amqp exchanges and queues 🚌 ✨
Stars: ✭ 86 (-24.56%)
Mutual labels:  rabbitmq, amqp
Aio Pika
AMQP 0.9 client designed for asyncio and humans.
Stars: ✭ 611 (+435.96%)
Mutual labels:  rabbitmq, amqp
Yii2 Queue
Yii2 Queue Extension. Supports DB, Redis, RabbitMQ, Beanstalk and Gearman
Stars: ✭ 977 (+757.02%)
Mutual labels:  rabbitmq, amqp
Machinery
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Stars: ✭ 5,821 (+5006.14%)
Mutual labels:  rabbitmq, amqp
Yii2 Rabbitmq
RabbitMQ Extension for Yii2
Stars: ✭ 52 (-54.39%)
Mutual labels:  rabbitmq, amqp
Php Amqplib
The most widely used PHP client for RabbitMQ
Stars: ✭ 3,950 (+3364.91%)
Mutual labels:  rabbitmq, amqp
Amqp
Go client for AMQP 0.9.1
Stars: ✭ 4,170 (+3557.89%)
Mutual labels:  rabbitmq, amqp
Rabbitmq Server
Open source RabbitMQ: core server and tier 1 (built-in) plugins
Stars: ✭ 9,064 (+7850.88%)
Mutual labels:  rabbitmq, amqp
Bunny
Bunny is a popular, easy to use, mature Ruby client for RabbitMQ
Stars: ✭ 1,224 (+973.68%)
Mutual labels:  rabbitmq, amqp

RabbitMQ-mock

Codacy Badge Build Status Coverage Status Maven Central JitPack License FOSSA Status

Mock for RabbitMQ Java amqp-client.

Compatible with versions 4.0.0 to 5.9.0 of com.rabbitmq:amqp-client

Compatible with versions 3.6.3 to 4.0.0 with the com.github.fridujo.rabbitmq.mock.compatibility package.

Motivation

This project aims to emulate RabbitMQ behavior for test purposes, through:

Example Use

Replace the use of com.rabbitmq.client.ConnectionFactory by MockConnectionFactory

ConnectionFactory factory = new MockConnectionFactory();
try (Connection conn = factory.newConnection()) {
    try (Channel channel = conn.createChannel()) {
        GetResponse response = channel.basicGet(queueName, autoAck);
        byte[] body = response.getBody();
        long deliveryTag = response.getEnvelope().getDeliveryTag();

        // Do what you need with the body

        channel.basicAck(deliveryTag, false);
    }
}

More details in integration-test

With Spring

Change underlying RabbitMQ ConnectionFactory by MockConnectionFactory

@Configuration
@Import(AppConfiguration.class)
class TestConfiguration {
    @Bean
    ConnectionFactory connectionFactory() {
        return new CachingConnectionFactory(new MockConnectionFactory());
    }
}

More details in integration-test

Contribute

Any contribution is greatly appreciated. Please check out the guide for more details.

Open in Gitpod

Getting Started

Maven

Add the following dependency to your pom.xml

<dependency>
    <groupId>com.github.fridujo</groupId>
    <artifactId>rabbitmq-mock</artifactId>
    <version>1.1.1</version>
    <scope>test</scope>
</dependency>

Gradle

Add the following dependency to your build.gradle

repositories {
	mavenCentral()
}

// ...

dependencies {
	// ...
	testCompile('com.github.fridujo:rabbitmq-mock:1.1.1')
	// ...
}

Building from Source

You need JDK-8 to build RabbitMQ-Mock. The project can be built with Maven using the following command.

mvn clean package

Tests are split in:

  • unit tests covering features and borderline cases: mvn test
  • integration tests, seatbelts for integration with Spring and Spring-Boot. These tests use the maven-invoker-plugin to launch the same project (in src/it/spring_boot) with different versions of the dependencies: mvn integration-test
  • mutation tests, to help understand what is missing in test assertions: mvn org.pitest:pitest-maven:mutationCoverage

Installing in the Local Maven Repository

The project can be installed in a local Maven Repository for usage in other projects via the following command.

mvn clean install

Using the latest SNAPSHOT

The master of the project pushes SNAPSHOTs in Sonatype's repo.

To use the latest master build add Sonatype OSS snapshot repository, for Maven:

<repositories>
    ...
    <repository>
        <id>sonatype-oss-spanshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

For Gradle:

repositories {
    // ...
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots"
    }
}

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].