Package com.github.sonus21.rqueue.core
Interface Job
-
- All Known Implementing Classes:
JobImpl
public interface JobOn each execution Rqueue creates a job to track it's status and execution progress.A job belongs to a single message poll, each message listener call creates an execution
Executionand that has a detail for specific execution. Overall job status can be found using this job interface. This object is available viaHeaderin listener method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckIn(java.io.Serializable message)Checkin allows you to display a message for long running tasks, so that you can see the progress.java.lang.ThrowablegetException()Any error detail, if it fails during executionlonggetExecutionTime()Total execution time of the fetched RqueueMessagesjava.lang.StringgetId()Get job id corresponding to a messagejava.lang.ObjectgetMessage()A message that was enqueuedMessageMetadatagetMessageMetadata()MessageMetadata corresponding the enqueued messageQueueDetailgetQueueDetail()Queue detail on which this job was executingRqueueMessagegetRqueueMessage()RqueueMessage that's consumed by this jobJobStatusgetStatus()The current status of this job, the message can have different status.
-
-
-
Method Detail
-
getId
java.lang.String getId()
Get job id corresponding to a message- Returns:
- string job id
-
getRqueueMessage
RqueueMessage getRqueueMessage()
RqueueMessage that's consumed by this job- Returns:
- an object of RqueueMessage
-
checkIn
void checkIn(java.io.Serializable message)
Checkin allows you to display a message for long running tasks, so that you can see the progress.The checking message could be anything given message's JSON serializable/deserializable. The message could be the current status of the job or anything else.
NOTE: Checkin is not allowed for periodic job
- Parameters:
message- a serializable message
-
getMessage
java.lang.Object getMessage()
A message that was enqueued- Returns:
- an object could be null if deserialization fail.
-
getMessageMetadata
MessageMetadata getMessageMetadata()
MessageMetadata corresponding the enqueued message- Returns:
- message metadata object
-
getStatus
JobStatus getStatus()
The current status of this job, the message can have different status.- Returns:
- job status
- See Also:
MessageMetadata
-
getException
java.lang.Throwable getException()
Any error detail, if it fails during execution- Returns:
- an error object
-
getExecutionTime
long getExecutionTime()
Total execution time of the fetched RqueueMessages- Returns:
- total execution time, that's sum of all listener method calls.
-
getQueueDetail
QueueDetail getQueueDetail()
Queue detail on which this job was executing- Returns:
- queue detail object
-
-