Package net.blakez.bppmq.rest
Class Queue
java.lang.Object
net.blakez.bppmq.rest.Queue
@Path("/queue")
@Produces("application/json")
@Consumes("application/json")
public class Queue
extends Object
REST endpoints for Push Pull Queue operations.
- Author:
- Peter Blakeley : @pblakez pb@blakez.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
clearBefore
(String topic, long index) Clears messages before a specific index.jakarta.ws.rs.core.Response
Gets the count of messages from a specific index onwards.jakarta.ws.rs.core.Response
Gets metadata for a topic.jakarta.ws.rs.core.Response
Pulls a single message by topic and index.jakarta.ws.rs.core.Response
Pulls a batch of messages starting from an index.jakarta.ws.rs.core.Response
Pulls messages from a specific index with batch size limit.jakarta.ws.rs.core.Response
Pushes a single message to a topic.jakarta.ws.rs.core.Response
Pushes multiple messages to a topic.
-
Constructor Details
-
Queue
public Queue()
-
-
Method Details
-
push
@POST @Path("/push") public jakarta.ws.rs.core.Response push(@QueryParam("topic") String topic, String message) Pushes a single message to a topic.- Parameters:
topic
- The topic to push to.message
- The message content.- Returns:
- Response containing the push result.
-
pushBatch
@POST @Path("/pushBatch") public jakarta.ws.rs.core.Response pushBatch(@QueryParam("topic") String topic, List<String> messages) Pushes multiple messages to a topic.- Parameters:
topic
- The topic to push to.messages
- List of message contents.- Returns:
- Response containing the batch push result.
-
pull
@GET @Path("/pull") public jakarta.ws.rs.core.Response pull(@QueryParam("topic") String topic, @QueryParam("index") long index) Pulls a single message by topic and index.- Parameters:
topic
- The topic to pull from.index
- The message index.- Returns:
- Response containing the message.
-
pullBatch
@GET @Path("/pullBatch") public jakarta.ws.rs.core.Response pullBatch(@QueryParam("topic") String topic, @QueryParam("index") long index, @QueryParam("batchSize") long batchSize) Pulls a batch of messages starting from an index.- Parameters:
topic
- The topic to pull from.index
- The starting index.batchSize
- The maximum number of messages to retrieve.- Returns:
- Response containing the message batch.
-
pullFrom
@GET @Path("/pullFrom") public jakarta.ws.rs.core.Response pullFrom(@QueryParam("topic") String topic, @QueryParam("from") long from, @QueryParam("batchSize") long batchSize) Pulls messages from a specific index with batch size limit.- Parameters:
topic
- The topic to pull from.from
- The starting index.batchSize
- The maximum number of messages to retrieve.- Returns:
- Response containing the messages.
-
countFrom
@GET @Path("/countFrom") public jakarta.ws.rs.core.Response countFrom(@QueryParam("topic") String topic, @QueryParam("from") long from) Gets the count of messages from a specific index onwards.- Parameters:
topic
- The topic to count from.from
- The starting index.- Returns:
- Response containing the count.
-
meta
Gets metadata for a topic.- Parameters:
topic
- The topic to get metadata for.- Returns:
- Response containing the metadata.
-
clearBefore
@POST @Path("/clearBefore") public jakarta.ws.rs.core.Response clearBefore(@QueryParam("topic") String topic, @QueryParam("index") long index) Clears messages before a specific index.- Parameters:
topic
- The topic to clear messages from.index
- The index before which to clear messages.- Returns:
- Response containing the updated metadata.
-