Interface MessageHandler


public interface MessageHandler
Interface for classes which will process ("dequeue") a message
  • Method Details

    • onMessage

      TaskResult onMessage​(Message message, GridTaskContext ctx, PlatformUserContext context) throws java.lang.Exception
      This method is called when the Message is ready for processing
      Parameters:
      message - Message to be processed
      ctx - describes the GridTask which is being used to manage the Message in the queue
      context - 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 have onMessage(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 queue
      context - administrative user context