public interface ClaimApi
Modifier and Type | Method and Description |
---|---|
List<Message> |
claim(int ttl,
int grace,
int limit)
This operation claims a set of messages (up to the value of the limit parameter) from oldest to newest and skips
any messages that are already claimed.
|
Claim |
get(String claimId)
Gets a specific claim and the associated messages.
|
boolean |
release(String claimId)
This operation immediately releases a claim, making any remaining, undeleted messages that are associated with
the claim available to other workers.
|
boolean |
update(String claimId,
int ttl)
Clients should periodically renew claims during long-running batches of work to avoid losing a claim while
processing a message.
|
@Named(value="claim:claim") List<Message> claim(int ttl, int grace, int limit)
ttl
- The TTL attribute specifies how long the server waits before releasing the claim. The ttl value
must be between 60 and 43200 seconds (12 hours). You must include a value for this attribute in
your request.grace
- The grace value specifies the message grace period in seconds. The value of grace value must
be between 60 and 43200 seconds (12 hours). You must include a value for this attribute in your
request.limit
- Specifies the number of messages to return, up to 20 messages.@Named(value="claim:get") @Nullable Claim get(String claimId)
claimId
- Specific claim ID of the message to get.@Named(value="claim:update") boolean update(String claimId, int ttl)
claimId
- Specific claim ID of the message to get.ttl
- The ttl attribute specifies how long the server waits before releasing the claim. The ttl value
must be between 60 and 43200 seconds (12 hours). You must include a value for this attribute in
your request.@Named(value="claim:delete") boolean release(String claimId)
claimId
- Specific claim ID of the message to get.Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.