Mock for RabbitMQ Java amqp-client

Overview

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

Comments
  • On stream restart, the mock stops working

    On stream restart, the mock stops working

    I got the following set-up: Producer actor -> Akka stream -> alpakka-amqp -> Consumer akka stream

    When I restart either stream (which implies draining the stream, canceling upstream and completing downstream, and then creating a new stream with the same AmqpConnectionProvider and configs), the mock stops working with the new stream.

    Using messageCount and consumerCount on the used channel shows the correct number of messages waiting to be read and the new consumer in there (for example, starts at one, goes to 0 when the stream is shutdown and back to 1 when it is recreated), but nothing is delivered to the stream.

    Using the same set-up on a real RMQ server instead of the mock seems to be working. Any idea?

    bug 
    opened by mdiasribeiro 11
  • x-death headers are not added to the message when its Dead lettered .

    x-death headers are not added to the message when its Dead lettered .

    Hi Team ,

    On application exception i'm Dead lettering the message .( channel.basicNack with requeue false)

    When i try to consume the message from DLQ, the messages does not have the x-death headers .

    bug 
    opened by gr423 9
  • after queue shut down stop delivering more messages

    after queue shut down stop delivering more messages

    Given a queue contains a message that is being nacked by the consumer, we need to break the consumption loop upon connection shutdown, otherwise the consumer will continue to process messages.

    This behavior resembles the behavior of a real rabbitmq connection that cannot receive more messages after a shutdown.

    bug 
    opened by madmuffin1 8
  • Failed to declare queue

    Failed to declare queue

    Hello,

    I'm using spring boot version 2.1.2.RELEASE, amqp-client:5.4.3 and rabbitmq-mock:1.0.9. When I try to mock the RabbitMQ Connection Factory like the showed example:

        @Bean
        public ConnectionFactory connectionFactory() {
            return new CachingConnectionFactory(MockConnectionFactoryFactory.build());
        }
    

    I'm receiving error org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[****(name of queue)]

    I was using this library with spring boot version 2.0.6.RELEASE it was working perfect.

    Can you please check it :)

    integration 
    opened by vencivenc 7
  • Messages must be consumed before another Message is published

    Messages must be consumed before another Message is published

    For a spring boot test case i do send multiple messages to an exchange routing to an single queue in a test setup. While verifying the messages in the queue only the first message can be consumed. Any further rabbitTemplate.receive() calls for the remaining messages deliver null (with a sufficient timeout). The tests do work though if i immediately consume messages after sending before publishing the next one. Regardless of this behavior being intended... it might be useful to be able to queue multiple messages at once

    bug 
    opened by twahage 6
  • Fix race condition on the message queue

    Fix race condition on the message queue

    The messages queue is accessed and mutated concurrently by both consumer and producer threads.

    Quoting the PriorityQueue javadoc documentation:

    Multiple threads should not access a PriorityQueue instance concurrently if any of the threads modifies the queue. Instead, use the thread-safe PriorityBlockingQueue class.

    I'm actually facing this situation in my project where once in a while a message gets lost causing the tests to fail.

    Thank you for this great open source project!

    bug 
    opened by thorin 6
  • Synchronize access to thread unsafe maps in MockQueue

    Synchronize access to thread unsafe maps in MockQueue

    I didn't add a test for this as nothing functionally changed and is hard to test threading issues.

    Let me know if you think that is acceptable or not.

    Suffice to say, LinkedHashMap is not safe to use by multiple threads (PriorityBlockingQueue, the other structure used in MockQueue, is though)

    opened by hjohn 5
  • MockQueue should not use declaring channel for metrics

    MockQueue should not use declaring channel for metrics

    Fix for #125.

    When trying to use the MockConnectionFactory for integration tests for a Spring Boot application I noticed that metrics were not complete when using a transaction manager. Upon further investigation I noticed MockQueue stores the MockChannel used to create it. It subsequently uses this in deliverToConsumerIfPossible to register consumption.

    This means that acknowledgements are not recorded in AbstractMetricsCollector.updateChannelStateAfterAckReject for single messages because channelState.unackedMessageDeliveryTags does not contain the consumption, instead it was recorded against the channel used to declare the queue.

    I've provided a PR with two commits. The first provides a failing test, the second commit introduces a fix which stores the MockChannel in the ConsumerAndTag when basicConsume is called so it can be used when delivering to the consumer.

    I came across this whilst creating a Spring Boot integration test since one channel is created by the RabbitAdmin and the other by the RabbitTransactionManager. I use the metrics to check for acks before testing the output of the application.

    opened by RedMu 5
  • MockChannel: Overridden methods do not declare exceptions

    MockChannel: Overridden methods do not declare exceptions

    Issue summary:

    Methods in MockChannel which override Channel interface methods do not declare the same exceptions. For example, basicAck does not declare an IOException:

    Channel:

        void basicAck(long deliveryTag, boolean multiple) throws IOException;
    

    MockChannel:

        @Override
        public void basicAck(long deliveryTag, boolean multiple) {
            getTransactionOrNode().basicAck(deliveryTag, multiple);
            metricsCollectorWrapper.basicAck(this, deliveryTag, multiple);
        }
    

    Why it matters:

    Without the declared exceptions, it is not possible to mock throwing of the checked exception. Example / use-case:

    try(Channel channel = Mockito.spy(conn.createChannel())) {
      assertThat(channel).isInstanceOf(MockChannel.class);
      
      Mockito.doThrow(new IOException("ACK failed"))
        .when(channel)
        .basicAck(anyLong(), anyBoolean());
      
      // If the ACK fails (i.e. throws an IOException, my app will try 3 times.
      // This is the behaviour I want to test
      verify(channel, times(3)).basicAck(anyLong(), anyBoolean());
    }
    

    Due to the undeclared exception, this test results in an error: Checked exception is invalid for this method!

    Is this a valid use case?

    Is this a valid use-case, or am I using rabbitmq-mock incorrectly?

    If its a valid issue, I'm happy to create a PR to fix it if that's OK?

    enhancement community feedback wanted 
    opened by joeltoby 5
  • Include bind arguments as part of equals/hashCode in BindConfiguration

    Include bind arguments as part of equals/hashCode in BindConfiguration

    We discovered that when creating two queue bindings on the same exchange which only differ in binding arguments that rabbit mock will not deliver messages to the queue for all of the possible bindings (ie, one of the bindings simply does not work despite a message being delivered to the exchange with correct arguments).

    This is because the BindConfigurations are at some point compared and its equals/hashCode does not take the binding arguments into account.

    This PR shows a potential solution which fixes our test cases.

    opened by hjohn 4
  • Backdoor to queues

    Backdoor to queues

    The test examples send and receive messages from the same queue. In practice often an application receives messages from one queue and sends them to another. Are there plans to implement direct access to the MockQueue and its messages ? Use case: application only sends messages to queue1. In the test run the code and check that the messages in MockQueue which mocks queue1 contain the expected content. (Scala, for instance, has a special backdoor TestActorRef which gives direct access to the underlying actor and its mailbox.)

    enhancement 
    opened by asomov 4
  • Bump spring-rabbit from 2.4.7 to 3.0.0

    Bump spring-rabbit from 2.4.7 to 3.0.0

    Bumps spring-rabbit from 2.4.7 to 3.0.0.

    Release notes

    Sourced from spring-rabbit's releases.

    v3.0.0

    Change log:

    0ac21dd4b Remove RestTemplate.close() Call 2351e650d Upgrade Versions; Prepare for Release ce78ad372 Docs for Native Images ba4ef9bc8 Fix Class Tangle d8f78ee29 GH-1533: Template Receive with Consumer Args e19be2e20 Fix typo in amqp.adoc 2b177d9f9 Add spring-amqp-bom 7594c3a24 Fix Plugin Repos 0359526ed Upgrade Micrometer Versions 49d35adb8 Upgrade to Jackson 2.14.0 9a5548425 Address Sonar Issue e065b0703 Address Sonar Issues 1f2fd026d Address Sonar Issue cdcaa6e9a Address Sonar Issues e7d7244b3 Address Sonar Issues b9b205fef TestContainers Compatibility, Version 8a4786202 GH-1382: Sonar Issues 79808a84b GH-1382: Republish Recoverer Improvements 41802039a GH-1528: Fix Possible Type Pollution f2fc13b6e GH-1425: Configure ReplyPostProcessor via Factory 0459c9907 GH-1524: Fix ThreadChannelCF with Transactional 36e98a735 GH-1444: Observation Doc Gen Polishing 77dfa657d GH-1477: Reduce Log Noise While Broker Down 2a4a0ecb6 GH-1517: Fix Javadoc, CheckStyle 0bc387f91 GH-1517: Add Since Tag b9b83f9bf GH-1517: Docs and Polishing for Composite Cust. aa86a0292 GH-1517: Add CompositeContainerCustomizer

    v3.0.0-RC1

    Change log:

    ea0daee21 Upgrade Versions; Prepare for Release 6e23963c3 GH-1419: Increase New Code Test Coverage 82c69d535 GH-1419: Fix Local Node Name in Tests 7ddee2113 Improve Management Plugin Test 4927cc58a GH-1419: Sonar Fixes 8045f2c86 GH-1419: Fix Early Exit in NodeLocator 8b4dd8665 GH-1514: Pattern-Matched instanceof Where Possible b1ae21cad GH-1419: Add RestTemplateNodeLocator c143c5b02 GH-1419: Remove RabbitMQ http-client Usage 639eb160e GH-1444: Observablility Documentation 506abd5e9 GH-1509: Add Concurrency for Super Streams 52e49cba8 Fix Stream RabbitListenerTests e0c656885 Fix AbstractIntegrationTests 0cce53331 Fix Stream TestContainer 4ee9d21a5 Upgrade stream-client, Docker Image 732f0da28 GH-1465: Super Stream Support in Template

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependency upgrade 
    opened by dependabot[bot] 0
  • `MockQueue` uses unsynchronized `LinkedHashMap`s which can cause `ConcurrentModificationException` or halts message consumption

    `MockQueue` uses unsynchronized `LinkedHashMap`s which can cause `ConcurrentModificationException` or halts message consumption

    The MockQueue class has many unsynchronized LinkedHashMaps. Any access, even read access like calling size() that may occur on different threads must be synchronized or the JVM is free to cache these values for the current thread. This can cause for example a message that is being received by a queue almost simultaneously with a consumer being added to be not delivered (and delivery can stop altogether even if more message are sent). It can also cause ConcurrentModificationExceptions; here's an example that I've seen:

    java.util.ConcurrentModificationException: null
    at java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:756)
    at java.base/java.util.LinkedHashMap$LinkedKeyIterator.next(LinkedHashMap.java:778)
    at com.github.fridujo.rabbitmq.mock.MockQueue.doWithUnackedUntil(MockQueue.java:323)
    at com.github.fridujo.rabbitmq.mock.MockQueue.basicAck(MockQueue.java:200)
    at com.github.fridujo.rabbitmq.mock.MockNode.lambda$basicAck$0(MockNode.java:120)
    at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4780)
    at com.github.fridujo.rabbitmq.mock.MockNode.basicAck(MockNode.java:120)
    at com.github.fridujo.rabbitmq.mock.MockChannel.basicAck(MockChannel.java:407)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:1162)
    at jdk.proxy2/jdk.proxy2.$Proxy181.basicAck(Unknown Source)
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.commitIfNecessary(BlockingQueueConsumer.java:876)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1048)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:940)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:84)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.mainLoop(SimpleMessageListenerContainer.java:1317)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1223)
    at java.base/java.lang.Thread.run(Thread.java:833)
    

    I've fixed these problems locally, but I've already have two Pull Requests open on this project that have unfortunately not had any response, and I'm not sure if it is worth my time to make a 3rd PR to get this fixed.

    The project seems somewhat abandoned -- are you looking for help? I wouldn't mind integrating the fix above, and my other two PR's and cutting a new release.

    If it is abandoned, would you have any objection in my forking this project and releasing it to Maven central under my own groupId?

    opened by hjohn 2
  • [Snyk] Security upgrade com.lightbend.akka:akka-stream-alpakka-amqp_2.13 from 2.0.1 to 4.0.0

    [Snyk] Security upgrade com.lightbend.akka:akka-stream-alpakka-amqp_2.13 from 2.0.1 to 4.0.0

    Snyk has created this PR to fix one or more vulnerable packages in the `maven` dependencies of this project.

    Changes included in this PR

    • Changes to the following files to upgrade the vulnerable dependencies to a fixed version:
      • src/it/alpakka/pom.xml

    Vulnerabilities that will be fixed

    With an upgrade:

    Severity | Priority Score (*) | Issue | Upgrade | Breaking Change | Exploit Maturity :-------------------------:|-------------------------|:-------------------------|:-------------------------|:-------------------------|:------------------------- critical severity | 704/1000
    Why? Has a fix available, CVSS 9.8 | Man-in-the-Middle (MitM)
    SNYK-JAVA-COMRABBITMQ-598771 | com.lightbend.akka:akka-stream-alpakka-amqp_2.13:
    2.0.1 -> 4.0.0
    | Yes | No Known Exploit

    (*) Note that the real score may have changed since the PR was raised.

    Check the changes in this PR to ensure they won't cause issues with your project.


    Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

    For more information: 🧐 View latest project report

    🛠 Adjust project settings

    📚 Read more about Snyk's upgrade and patch logic


    Learn how to fix vulnerabilities with free interactive lessons:

    🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

    opened by snyk-bot 0
  • rabbitTemplate receive() does not dequeue message

    rabbitTemplate receive() does not dequeue message

    I have this simple test. As you can see, calling rabbitTemplate.receive() did not remove message from the queue, although the same message was received every time I called this method. This issue does not happen if I hook to a real rabbitmq

    @TestConfiguration
    public class TestConfig {
    
        @Bean
        @Primary
        ConnectionFactory connectionFactory() {
            return new CachingConnectionFactory(new MockConnectionFactory());
        }
    
        @Bean
        @Primary
        public RabbitAdmin getTestRabbitAdmin(ConnectionFactory connectionFactory) {
            RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
            rabbitAdmin.setAutoStartup(true);
            return rabbitAdmin;
        }
    
        @Bean
        @Primary
        public RabbitTemplate getTestRabbitTemplate(ConnectionFactory connectionFactory) {
            return new RabbitTemplate(connectionFactory);
        }
    }
    
    
    @SpringBootTest
    @Import(TestConfig.class)
    class SampleTest {
        @Autowired
        private RabbitTemplate rabbitTemplate;
    
        @Autowired
        private RabbitAdmin rabbitAdmin;
    
        @Test
        void test() throws Exception {
             rabbitTemplate.send("test-exchange", "test-key", new Message("test".getBytes(StandardCharsets.UTF_8)));
    
            Thread.sleep(500);
            QueueInformation info0 = rabbitAdmin.getQueueInfo("test-queue");  // QueueInformation [name=test-queue, messageCount=1, consumerCount=0]
    
            Message message1 = rabbitTemplate.receive("test-queue", -1);
            Thread.sleep(500);
            QueueInformation info1 = rabbitAdmin.getQueueInfo("test-queue");  // QueueInformation [name=test-queue, messageCount=1, consumerCount=1]
    
            Message message2 = rabbitTemplate.receive("test-queue", -1);
            Thread.sleep(500);
            QueueInformation info2 = rabbitAdmin.getQueueInfo("test-queue");  // QueueInformation [name=test-queue, messageCount=1, consumerCount=1]
        }
    }
    
    opened by lz000 0
  • Add new stream typed queue

    Add new stream typed queue

    This contribution derives from issue (feature request) https://github.com/fridujo/rabbitmq-mock/issues/281

    This PR is not ready to be merged. There are many things to look out for and the code style is not compliant.

    Also, I cannot seem to pass a test for plugin com.github.fridujo:rabbitmq-mock-alpakka-amqp-integration

    [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.138 s <<< FAILURE! - in com.github.fridujo.rabbitmq.mock.integration.alpakka.AmqpConnectorsTest
    [ERROR] publishAndConsumeRpcWithoutAutoAck  Time elapsed: 10.053 s  <<< FAILURE!
    java.lang.AssertionError: assertion failed: timeout (4999314094 nanoseconds) during expectMsgClass waiting for interface akka.stream.testkit.TestSubscriber$SubscriberEvent
            at com.github.fridujo.rabbitmq.mock.integration.alpakka.AmqpConnectorsTest.publishAndConsumeRpcWithoutAutoAck(AmqpConnectorsTest.java:121)
    
    [INFO] 
    [INFO] Results:
    [INFO] 
    [ERROR] Failures: 
    [ERROR]   AmqpConnectorsTest.publishAndConsumeRpcWithoutAutoAck:121 assertion failed: timeout (4999314094 nanoseconds) during expectMsgClass waiting for interface akka.stream.testkit.TestSubscriber$SubscriberEvent
    [INFO] 
    [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
    
    enhancement 
    opened by hanzo2001 2
  • New RabbitMQ Streams Feature

    New RabbitMQ Streams Feature

    As of RabbitMQ 3.9 there is a new feature called Streams.

    I was testing a small setup that I have with Apache Camel and RabbitMQ Streams until I found a configuration that works. I then chose to swap the ConnectionFactory with the Mock version. Almost everything works as expected but I will leave the few details that this mocking tool might want to add.

    Regarding declaration, there is a new queue type: stream (the mock still works but it will become important for the behavior under testing). There are many other details but those are policy driven. I don't know if it these details would be interesting for this mock tool. Binding works exactly the same as any classic queue and the exchanges.

    As far as the declaration goes, Streams

    • must have autoAck set to false,
    • must store all it's messages in an addressable fashion
      • by index (for offsets)
      • by timestamp (for dates)

    Regarding the message persistence, Streams are hardcoded to persist everything and consumers cannot cause messages to disappear from the Stream. RabbitMQ does have a mechanism to shorten the Stream itself by way of policies (max-age, etc). Again, I don't know if these features are supposed to come in handy for a mock tool.

    The queued messages must be accessible by a few methods

    • "first" starts at the first available message;
    • "last" starts at last written chunk (chunking is the storage segmentation mechanism, which would have to be incorporated for this feature to make sense, which I don't know if it is overkill for this tool);
    • "next" starts at the end and will consume the first new offset written to the stream, this is the default if the offset is not declared;
    • numerical offset (long) is self explanatory (0 based indexing);
    • timestamp (java.util.Date) will start consuming from the closest message timestamp;
    • an interval string (e.g.: "1D 20h 15m 22s") will start consuming from the date resulting in the subtraction of interval from the current date.

    Regarding consumers, they will have to define some form of Stream offset to start reading from (the option x-stream-offset or "next" if undeclared) which can be populated by the different kinds of values described above.

    In addition, Stream consumers

    • must have qos (a prefetch size) defined on the channel,
    • must manually acknowledge the delivery,
    • must somehow store the offset in a durable medium to survive a reboot (this feature is supposedly handled by RabbitMQ but the AMQP0.9.1 spec and clients do not make use of this),
    • must be provided the current offset of the message in the message.properties.headers["x-stream-offset"] so that they may store the offset to pick up after a reboot.

    The RabbitMQ team is already working on a RabbitMQ Java Stream client library but the amqp-0.9.1 client is supposed to be able to provide the low level features so implementers can choose their own method.

    In summary, a healthy minimum set of features could be

    • a new queue type: stream
      • Streams keep all messages stored
      • Streams keep a numerical index
      • Streams keep a timestamp index
    • stream consumers
      • must not autoAck (consumer should fail to set up),
      • must define qos (prefetch) (consumer should fail to set up),
      • should provide the option "x-stream-offset" ("first", "next", offset, timestamp)
      • must be provided the current message offset in the headers under "x-stream-offset" of each message.

    More Info at the source

    • https://www.rabbitmq.com/streams.html
    enhancement 
    opened by hanzo2001 1
Releases(1.1.1)
  • 1.1.1(Jul 22, 2020)

    🐞 Bug fixes

    • #125 Fix Metrics recorded by MockQueue (fixed by @RedMu)
    • #133 Clear transaction after rollback (fixed by @KayWu)
    • #137 Fix Topic exchange mathing algorithm (reported by @mdiasribeiro)
    • #139 Upgrade Alpakka integration test that was randomly failling

    🔨 Dependency upgrades

    • integration-test
      • micrometer-core to 1.5.2
      • spring-rabbit to 2.2.8.RELEASE
    • test
      • mockito-core to 3.4.4
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(May 23, 2020)

    ⭐️ Features

    • Add access to messages in mock queues (#87)
    • Add FOSSA check

    🐞 Bug fixes

    • Fix MetricsCollector#consumedMessage invocation order (#117)
    • Requeue unacked messages delivered to a consumer when it is cancelled (#96)

    🔨 Dependency upgrades

    • integration-test
      • micrometer-core to 1.5.1
      • spring-rabbit to 2.2.7.RELEASE
    • test
      • mockito-core to 3.3.3
      • junit-jupiter to 5.6.2
      • assertj-core to 3.16.1
    • maven
      • pitest-maven to 1.5.2
      • maven-javadoc-plugin to 3.2.0
    Source code(tar.gz)
    Source code(zip)
  • 1.0.14(Feb 9, 2020)

    ⭐️ Features

    • Add IT for Spring-Boot 2.2.2 (#76)
    • Support reply-to (#82 thanks to @yfunikov)
    • Add Maven wrapper (#85 thanks to @asomov)
    • Use the implicit local Maven repository for maven-invoker-plugin (#89 thanks to @asomov)
    • Support RpcClient using mandatory flag (#93 thanks to @janssk1)

    🐞 Bug fixes

    • Make queue.delete and exchange.delete methods idempotent (#74)

    🔨 Dependency upgrades

    • integration-test
      • spring-rabbit to 2.2.3.RELEASE
      • micrometer-core to 1.3.3
    • test
      • junit-jupiter to 5.6.0
      • mockito-core to 3.2.4
      • assertj-core to 3.15.0
    • maven
      • pitest-maven to 1.4.11
      • pitest-junit-plugin to 0.11
      • maven-source-plugin to 3.2.1
    Source code(tar.gz)
    Source code(zip)
  • 1.0.13(Dec 11, 2019)

    ⭐️ Features

    • Enabled dependabot to update dependencies as soon as they are released
    • Display IT logs after failure in Travis log
    • Add a Gitpod button in README for one-shot contributions

    🐞 Bug fixes

    • Fix transactional channel to support multiple commits after a single select

    🔨 Dependency upgrades

    • integration-test
      • micrometer-core to 1.3.2
      • spring-rabbit to 2.2.2.RELEASE
    • test
      • assertj-core to 3.14.0
      • mockito-core to 3.2.0
    • maven
      • pitest-junit-plugin to 0.10
      • jacoco-maven-plugin to 0.8.5
      • maven-source-plugin to 3.2.0
      • maven-gpg-plugin to 1.6
    Source code(tar.gz)
    Source code(zip)
  • 1.0.12(Oct 11, 2019)

    ⭐️ Features

    • Add Contribution guidelines (at last !)

    🐞 Bug fixes

    • Add x-death header to dead-lettered messages (thanks to @gr423)
    • Redelivered messages are now marked as such (thanks to @pawelebe)
    • Fix consumer cancelation when another connection is closed (was needed by akka-stream-alpakka-amqp, thanks for @mdiasribeiro for providing a test case covering the issue)

    🔨 Dependency upgrades

    • Upgrade to amqp-client 5.7.3
    • Replace Cobertura (deprecated) by JaCoCo (preparing Java9+ compatibility)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.10(Mar 12, 2019)

    ⭐️ Features

    • add the ability to register other type of exchanges (thanks to @jnbis)

    🐞 Bug fixes

    • make exchange.declare idempotent

    🔨 Dependency upgrades

    • upgrade to amqp-client 5.6.0
    Source code(tar.gz)
    Source code(zip)
  • 1.0.9(Jan 15, 2019)

    ⭐️ Features

    • add debug information in logs (using slf4j)

    🐞 Bug fixes

    • fix dead-lettering for queue without consumer

    🔨 Dependency upgrades

    • Upgrade to amqp-client 5.5.2
    Source code(tar.gz)
    Source code(zip)
  • 1.0.8(Nov 19, 2018)

    :beetle: Bug fixes

    • fix race condition when sending and consuming messages in the same time on the same queue, causing message loss when (#23 thanks to @thorin)

    🔨 Dependency upgrades

    • Upgrade to amqp-client 5.5.0
    • Upgrade for integration tests:
      • micrometer 1.1.0
      • spring-amqp 2.1.0.RELEASE
      • spring-boot 2.1.0.RELEASE
    • Various upgrade of build tools (JUnit, etc.)
    Source code(tar.gz)
    Source code(zip)
  • 1.0.7(Oct 19, 2018)

  • 1.0.6(Oct 16, 2018)

    Fix one bug spotted by @madmuffin1 about the previous exchange name used by the default exchange when publishing to a queue.

    Details in #17

    Source code(tar.gz)
    Source code(zip)
  • 1.0.5(Oct 10, 2018)

    Now supporting version 5.4.2 of amqp-client.

    Improvements:

    • support for
      • message TTL
      • transactions
      • Publisher Confirms
      • Queue length limit
      • priority Queues
      • dead-letter routing-key (thanks to @tobilarscheid)

    Tech:

    • better test coverage
    • mutation testing run

    Bugs:

    • thread leak fixed in MockQueue
    Source code(tar.gz)
    Source code(zip)
  • 1.0.4(Jul 7, 2018)

    Previous versions of amqp-client where missing classes or methods compared to the latest one.

    This release makes rabbitmq-mock compatible with versions prior to 4.0.0, missing :

    • AddressResolver
    • MetricsCollector
    Source code(tar.gz)
    Source code(zip)
  • 1.0.3(Jun 14, 2018)

  • 1.0.2(Jun 14, 2018)

    MetricsCollector is now called as with the real implementation.

    Spring specific classes as been removed in favor of using directly the CachingConnectionFactory with a MockConnectionFactory delegate.

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Jun 4, 2018)

    All RabbitMQ methods are implemented.

    There is support for the following extensions of RabbitMQ:

    • basic.nack
    • Alternate Exchanges
    • Dead Lettering
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(May 7, 2018)

Owner
Fridujo
It's Esperanto for freezer
Fridujo
mall学习教程,架构、业务、技术要点全方位解析。mall项目(40k+star)是一套电商系统,使用现阶段主流技术实现。涵盖了SpringBoot 2.3.0、MyBatis 3.4.6、Elasticsearch 7.6.2、RabbitMQ 3.7.15、Redis 5.0、MongoDB 4.2.5、Mysql5.7等技术,采用Docker容器化部署。

mall学习教程 简介 mall学习教程,架构、业务、技术要点全方位解析。mall项目(40k+star)是一套电商系统,使用现阶段主流技术实现。涵盖了SpringBoot 2.3.0、MyBatis 3.4.6、Elasticsearch 7.6.2、RabbitMQ 3.7.15、Redis 5

macro 11.7k Jan 8, 2023
:herb: 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等:pushpin:

欢迎大家留言和PR~ Tip: 技术更新换代太快,本仓库仅做参考,自己的项目具体使用哪个版本还需谨慎思考~(不推荐使用最新的版本,推荐使用(最新-1|2)的版本,会比较稳定) spring-boot-quick 前言   自己很早就想搞一个总的仓库就是将自己平时遇到的和学习到的东西整合在一起,方便后

wangxc 2.1k Jan 2, 2023
:racehorse:基于SpringBoot + MySQL + Redis + RabbitMQ + Guava开发的高并发商品限时秒杀系统

系统介绍 本系统是使用SpringBoot开发的高并发限时抢购秒杀系统,除了实现基本的登录、查看商品列表、秒杀、下单等功能,项目中还针对高并发情况实现了系统缓存、降级和限流。 开发工具 IntelliJ IDEA + Navicat + Sublime Text3 + Git + Chrome 压测

FINN 2.3k Dec 27, 2022
EssentialClient is a client side mod originally forked from Carpet Client for 1.15.2 that implements new client side features

EssentialClient EssentialClient is a client side only mod originally forked from Carpet Client for 1.15.2 that implements new client side features. Th

null 62 Jan 3, 2023
This is the src of Badlion client 3.0.0, The reason of this repo is badlion client's owner being p e d o

About Badlion Using Gradle instead of the shit mcp uwu Commands Run with random username gradle startGame Run with another username gradle startGame -

Pace 32 Dec 2, 2022
This is the src of Badlion client 3.0.0, The reason of this repo is badlion client's owner being p e d o

About Badlion Using Gradle instead of the shit mcp uwu Commands Run with random username gradle startGame Run with another username gradle startGame -

Pace 32 Dec 2, 2022
ZerotierFix - An unofficial Zerotier Android client patched from official client

Zerotier Fix An unofficial Zerotier Android client patched from official client. Features Self-hosted Moon Support Add custom planet config via file a

KAAAsS 830 Jan 8, 2023
Official Elasticsearch Java Client

Elasticsearch Java Client The official Java client for Elasticsearch. Note: this project is still a work in progress. This client is meant to replace

elastic 230 Jan 8, 2023
SpringBoot show case application for reactive-pulsar library (Reactive Streams adapter for Apache Pulsar Java Client)

Reactive Pulsar Client show case application Prerequisites Cloning reactive-pulsar Running this application requires cloning https://github.com/lhotar

Lari Hotari 9 Nov 10, 2022
OBKV Table Client is Java Library that can be used to access table data from OceanBase storage layer.

OBKV Table Client OBKV Table Client is Java Library that can be used to access table data from OceanBase storage layer. Its access method is different

OceanBase 12 Dec 16, 2022
Community extension to generate a Java client from the provided Camunda 7 OpenAPI descitpion and also warp it into Spring Boot

Camunda Engine OpenAPI REST Client Java and Spring Boot This community extension is a convenience wrapper around the generated Java client from the Ca

Camunda Community Hub 29 Dec 28, 2022
Koios Java Client

Koios Java Client Library is based on Koios Elastic Query Layer for Cardano Node by Cardano Community Guild Operators.

Cardano Community 13 Dec 4, 2022
ReleaseFab is a Java client application which automatically generates Release Notes for any project.

ReleaseFab is a Java client application which atomatically generates Release Notes for any project. The information can be gathered from multiple different sources including the source code itself, the Git repository and an Application Lifecycle Management System of your choice.

comlet Verteilte Systeme GmbH 7 Jun 10, 2022
Java wrapper for Agones client SDK.

agones4j How to Use (Developers) Code final class Server { public static void main( final String[] args ) { final var sdk = new tr.com.in

Infumia LTD 6 Dec 15, 2022
@FengG0d 's Client, but he leave, I am the new owner, but, I don't know how to write Java, I need your help.

IKUN Client Help me I need help! The original Author was leave, but I don't know how to write a good client, I need Your help! to make a good IKun Cli

Chenken520 2 Sep 4, 2022
Simple AnimationUtil using Easing functions. Can be used anywhere, Hacked-Client, Mods, etc..

AnimationUtil Simple AnimationUtil using Easing functions. Can be used anywhere, Hacked-Client, Mods, etc.. Render example > https://gyazo.com/780b5d8

null 71 Jan 8, 2023
Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit Breaker + Resilience4J + FeignClient + RestTemplate

Spring boot microservice example Spring boot microservice example with Eureka Server + Eureka Client + Spring Cloud API Gateway + OAuth2.0 + Circuit B

Subhash Lamba 47 Dec 29, 2022
图书管理;图书管理系统;图书管理系统后端,该项目采用Springboot整合Mybatis对数据持久化以及Api的封装实现,前台项目地址:https://github.com/Nirunfeng/BookSys-Client

System of Book Management(sbm) 项目说明 图书管理系统后台,该项目采用Springboot整合Mybatis对数据持久化以及Api的封装实现,前台项目地址:BookSys-Client 项目启动 数据库:mysql5.6执行以下脚本,项目下脚本文件--sbm.sql 导

null 61 Dec 30, 2022
Shitty, yet simple way to get someone's token right at their discord client's startup.

discord-token-stealer Shitty, yet simple discord injector to add a little spice to their discord client Disclaimer: This is for educational purposes o

Gavin 3 Sep 26, 2022