Interface MessageHandler<T extends ChannelMessage>

Type Parameters:
T - the expected message type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageHandler<T extends ChannelMessage>
Handler for incoming messages on a subscribed channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(MessageChannel channel, T message)
    Handle an incoming message.
  • Method Details

    • handle

      void handle(@Nonnull MessageChannel channel, @Nonnull T message)
      Handle an incoming message.

      Implementations should be fast and non-blocking. Heavy processing should be offloaded to a separate thread.

      Parameters:
      channel - the channel the message was received on
      message - the message payload