Interface MessageHandler
public interface MessageHandler
Interface for classes which will process ("dequeue") a message
-
Method Summary
Modifier and Type Method Description void
onFailedByGridAdmin(Message message, java.lang.String reason, GridTaskContext ctx, PlatformUserContext context)
If the Message fails due to an issue such as a timeout (i.e.TaskResult
onMessage(Message message, GridTaskContext ctx, PlatformUserContext context)
This method is called when the Message is ready for processing
-
Method Details
-
onMessage
TaskResult onMessage(Message message, GridTaskContext ctx, PlatformUserContext context) throws java.lang.ExceptionThis method is called when the Message is ready for processing- Parameters:
message
- Message to be processedctx
- describes the GridTask which is being used to manage the Message in the queuecontext
- administrative user context- Returns:
- a TaskResult which indicates whether processing succeeded or not
- Throws:
java.lang.Exception
-
onFailedByGridAdmin
void onFailedByGridAdmin(Message message, java.lang.String reason, GridTaskContext ctx, PlatformUserContext context)If the Message fails due to an issue such as a timeout (i.e. has no opportunity to actually haveonMessage(Message, GridTaskContext, PlatformUserContext)
called), this method will be called to allow cleanup- Parameters:
reason
- failure reason (supplied by grid admin)ctx
- describes the GridTask which is being used to manage the Message in the queuecontext
- administrative user context
-