Skip to content

Commit 72cf50c

Browse files
author
Jonathan Gaillard
committed
Initial commit
0 parents  commit 72cf50c

File tree

6 files changed

+1042
-0
lines changed

6 files changed

+1042
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: java
2+
jdk:
3+
- openjdk7
4+
- oraclejdk7
5+
services: mongodb

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#mongo-queue-java
2+
[![Build Status](https://travis-ci.org/gaillard/mongo-queue-java.png)](https://travis-ci.org/gaillard/mongo-queue-java)
3+
4+
Java message queue using MongoDB as a backend
5+
Adheres to the 1.0.0 [specification](https://github.com/dominionenterprises/mongo-queue-specification).
6+
7+
##Features
8+
9+
* Message selection and/or count via MongoDB query
10+
* Distributes across machines via MongoDB
11+
* Multi language support through the [specification](https://github.com/dominionenterprises/mongo-queue-specification)
12+
* Message priority
13+
* Delayed messages
14+
* Running message timeout and redeliver
15+
* Atomic acknowledge and send together
16+
* Easy index creation based only on payload
17+
18+
##Simplest use
19+
20+
```java
21+
import com.mongodb.BasicDBObject;
22+
import com.mongodb.MongoClient;
23+
import gaillard.mongo.Queue;
24+
import java.net.UnknownHostException;
25+
26+
public final class Main {
27+
28+
public static void main(final String[] args) throws UnknownHostException {
29+
final Queue queue = new Queue(new MongoClient().getDB("testing").getCollection("messages"));
30+
queue.send(new BasicDBObject());
31+
final BasicDBObject message = queue.get(new BasicDBObject(), 60);
32+
queue.ack(message);
33+
}
34+
}
35+
```
36+
37+
##Jar
38+
39+
To add the library as a jar simply [Build](#project-build) the project and use the `mongo-queue-java-1.0.0.jar` from the created
40+
`target` directory!
41+
42+
##Maven (TODO: Add project to Sonar OSS repo)
43+
44+
To add the library as a local, per-project dependency use [Maven](http://maven.apache.org)! Simply add a dependency on
45+
to your project's `pom.xml` file such as:
46+
47+
```xml
48+
...
49+
<dependency>
50+
<groupId>gaillard</groupId>
51+
<artifactId>mongo-queue-java</artifactId>
52+
<version>1.0.0</version>
53+
</dependency>
54+
...
55+
```
56+
57+
##Documentation
58+
59+
Found in the [source](src/main/java/gaillard/mongo/Queue.java) itself, take a look!
60+
61+
##Contact
62+
63+
Developers may be contacted at:
64+
65+
* [Pull Requests](https://github.com/gaillard/mongo-queue-java/pulls)
66+
* [Issues](https://github.com/gaillard/mongo-queue-java/issues)
67+
68+
##Project Build
69+
70+
Install and start [mongodb](http://www.mongodb.org).
71+
With a checkout of the code get [Maven](http://maven.apache.org) in your PATH and run:
72+
73+
```bash
74+
mvn clean install
75+
```

pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>gaillard</groupId>
6+
<artifactId>mongo-queue-java</artifactId>
7+
<version>1.0.0</version>
8+
9+
<properties>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
</properties>
12+
13+
<dependencies>
14+
<dependency>
15+
<groupId>junit</groupId>
16+
<artifactId>junit</artifactId>
17+
<version>4.11</version>
18+
<scope>test</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>org.mongodb</groupId>
22+
<artifactId>mongo-java-driver</artifactId>
23+
<version>2.11.2</version>
24+
</dependency>
25+
</dependencies>
26+
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<artifactId>maven-compiler-plugin</artifactId>
31+
<version>2.3.2</version>
32+
<configuration>
33+
<source>1.7</source>
34+
<target>1.7</target>
35+
</configuration>
36+
</plugin>
37+
</plugins>
38+
</build>
39+
</project>

0 commit comments

Comments
 (0)