Miniature Queue: Core

TBA.

License

License

MIT License
GroupId

GroupId

com.github.mlk
ArtifactId

ArtifactId

miniature-queue-core-java7
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Miniature Queue: Core
TBA.
Source Code Management

Source Code Management

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

Download miniature-queue-core-java7

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
com.google.guava : guava jar 19.0

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