Interface MessageListenerExecutor


public interface MessageListenerExecutor
Interface for providing service to execute message listeners.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(Message<?> message, Runnable runnable)
    select a thread by message to execute the runnable!
  • Method Details

    • execute

      void execute(Message<?> message, Runnable runnable)
      select a thread by message to execute the runnable!

      Suggestions:

      1. The message listener task will be submitted to this executor for execution, so the implementations of this interface should carefully consider execution order if sequential consumption is required.

      2. The users should release resources(e.g. threads) of the executor after closing the consumer to avoid leaks.

      Parameters:
      message - the message
      runnable - the runnable to execute, that is, the message listener task