Miniature Queue: Rabbit MQ

TBA.

License

License

MIT License
GroupId

GroupId

com.github.mlk
ArtifactId

ArtifactId

miniature-queue-rabbitmq
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Miniature Queue: Rabbit MQ
TBA.
Source Code Management

Source Code Management

http://github.com/mlk/miniature-queue

Download miniature-queue-rabbitmq

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mlk/miniature-queue-rabbitmq/ -->
<dependency>
    <groupId>com.github.mlk</groupId>
    <artifactId>miniature-queue-rabbitmq</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mlk/miniature-queue-rabbitmq/
implementation 'com.github.mlk:miniature-queue-rabbitmq:0.0.1'
// https://jarcasting.com/artifacts/com.github.mlk/miniature-queue-rabbitmq/
implementation ("com.github.mlk:miniature-queue-rabbitmq:0.0.1")
'com.github.mlk:miniature-queue-rabbitmq:jar:0.0.1'
<dependency org="com.github.mlk" name="miniature-queue-rabbitmq" rev="0.0.1">
  <artifact name="miniature-queue-rabbitmq" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mlk', module='miniature-queue-rabbitmq', version='0.0.1')
)
libraryDependencies += "com.github.mlk" % "miniature-queue-rabbitmq" % "0.0.1"
[com.github.mlk/miniature-queue-rabbitmq "0.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
com.github.mlk : miniature-queue-core jar 0.0.1
com.rabbitmq : amqp-client jar 3.6.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
org.mockito : mockito-all jar 1.9.5

Project Modules

There are no modules declared in this project.

miniature-queue

Join the chat at https://gitter.im/mlk/miniature-queue Build Status codecov.io API Docs Dependency Status

miniature-queue is a Message Queue abstraction layer inspired by feign and JDBI. It uses annotation based meta-programming to bind an interface to an Message Queue implementation.

Example

@Queue("chat", queueTypeHint=QueueType.FANOUT_QUEUE)
interface Chat {
    @Publish
    void publishMessage(String message);
    @Handle
    void receiveMessage(Function<String, Boolean> action);
}

MessageQueue queue = Queuify.builder().server(createServerObject()).target(MessageQueue.class);
// Set up a listener for new messages.
queue.receiveMessage((x) -> { System.out.println(x); return true; } );
// Sends hello down the line
queue.publishMessage("Hello");

Queue types

Worker Queues

In a worker queue each message is sent to only one listener. The message publisher sends a fire-and-forget message out to the queue for the work to be done.

Fanout (or Publish/Subscribe)

In a fanout queue each message is sent to every listener. The message publisher sends a fire-and-forget message out to the queue for the listners to be informed.

Message Queues supported

Encoding/Decoding objects

Running the tests

Most of the tests for this project are integration tests rather than unit. As such they require the MQ server to be running. In order to make that happen we use Docker. You require either the enviroment variables DOCKER_CERT_PATH and DOCKER_HOST set, or to be running Docker on localhost with the standard port.

Maven Site

Versions

Version
0.0.1