|
| 1 | +#mongo-queue-java |
| 2 | +[](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 | +``` |
0 commit comments