Interface MessageApi
-
@Consumes("application/json") @Path("/messages") public interface MessageApi
Provides access to Messages via their REST API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessagesCreated
create(List<CreateMessage> messages)
Create message(s) on a queue.boolean
delete(Iterable<String> ids)
Deletes specific messages.boolean
deleteByClaim(String id, String claimId)
The claimId parameter specifies that the message is deleted only if it has the specified claim ID and that claim has not expired.Message
get(String id)
Gets a specific message.List<Message>
list(Iterable<String> ids)
Lists specific messages.MessageStream
stream(StreamMessagesOptions... options)
Streams the messages off of a queue.
-
-
-
Method Detail
-
create
@Named("message:create") @POST MessagesCreated create(List<CreateMessage> messages)
Create message(s) on a queue.- Parameters:
messages
- The messages created on the queue. The number of messages allowed in one request are configurable by your cloud provider. Consult your cloud provider documentation to learn the maximum.
-
stream
@Named("message:stream") @GET MessageStream stream(StreamMessagesOptions... options)
Streams the messages off of a queue. In a very active queue it's possible that you could continuously stream messages indefinitely.- Parameters:
options
- Options for streaming messages to your client.
-
list
@Named("message:list") @GET List<Message> list(Iterable<String> ids)
Lists specific messages. Unlike the stream method, a client's own messages are always returned in this operation.- Parameters:
ids
- Specifies the IDs of the messages to list.
-
get
@Named("message:get") @GET @Path("/{message_id}") @Nullable Message get(@PathParam("message_id") String id)
Gets a specific message. Unlike the stream method, a client's own messages are always returned in this operation.- Parameters:
id
- Specific ID of the message to get.
-
delete
@Named("message:delete") @DELETE boolean delete(Iterable<String> ids)
Deletes specific messages. If any of the message IDs are malformed or non-existent, they are ignored. The remaining valid messages IDs are deleted.- Parameters:
ids
- Specifies the IDs of the messages to delete.
-
deleteByClaim
@Named("message:delete") @DELETE @Path("/{message_id}") boolean deleteByClaim(@PathParam("message_id") String id, @QueryParam("claim_id") String claimId)
The claimId parameter specifies that the message is deleted only if it has the specified claim ID and that claim has not expired. This specification is useful for ensuring only one worker processes any given message. When a worker's claim expires before it can delete a message that it has processed, the worker must roll back any actions it took based on that message because another worker can now claim and process the same message.- Parameters:
id
- Specific ID of the message to delete.claimId
- Specific claim ID of the message to delete.
-
-