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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    clearBefore(String topic, long index)
    Clears messages before a specific index.
    jakarta.ws.rs.core.Response
    countFrom(String topic, long from)
    Gets the count of messages from a specific index onwards.
    jakarta.ws.rs.core.Response
    meta(String topic)
    Gets metadata for a topic.
    jakarta.ws.rs.core.Response
    pull(String topic, long index)
    Pulls a single message by topic and index.
    jakarta.ws.rs.core.Response
    pullBatch(String topic, long index, long batchSize)
    Pulls a batch of messages starting from an index.
    jakarta.ws.rs.core.Response
    pullFrom(String topic, long from, long batchSize)
    Pulls messages from a specific index with batch size limit.
    jakarta.ws.rs.core.Response
    push(String topic, String message)
    Pushes a single message to a topic.
    jakarta.ws.rs.core.Response
    pushBatch(String topic, List<String> messages)
    Pushes multiple messages to a topic.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      @GET @Path("/meta") public jakarta.ws.rs.core.Response meta(@QueryParam("topic") String topic)
      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.