There are three ways to get this package.
- Add it as a Maven dependency Your pom.xml will look something like:
<dependencies> <!-- IronMQ message queue client --> <dependency> <groupId>io.iron.ironmq</groupId> <artifactId>ironmq</artifactId> <version>0.0.14</version> </dependency> </dependencies>
Build from source with Apache Buildr:
The .jar file will appear under the target directory.
The full API is documented here, but here are some quick snippets to get you started.
Initialize a client and get a queue object:
Client client = new Client("my project", "my token", Cloud.ironAWSUSEast); Queue queue = client.queue("my_queue");
Push a message on the queue:
Pop a message off the queue:
Message msg = queue.get();
When you pop/get a message from the queue, it will not be deleted. It will eventually go back onto the queue after a timeout if you don't delete it. (The default timeout is 60 seconds.)
Delete a message from the queue: