Interface OnErrorConsumer

All Superinterfaces:
BiConsumer<String, Message<String>>
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 OnErrorConsumer extends BiConsumer<String, Message<String>>

Consumer for handling STOMP ERROR frames.

This consumer is called by the StompClient when an ERROR frame is received from the server. In that case the connection is closed by the server and no further communication is possible.

You may try to create a new StompClient instance to reconnect. However, it is recommended to investigate the cause of the error first, since it may indicate a serious issue with the STOMP communication.

Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(String m, Message<String> message)
    Accepts an error that occurred during STOMP communication.

    Methods inherited from interface BiConsumer

    andThen
  • Method Details

    • accept

      void accept(String m, Message<String> message)

      Accepts an error that occurred during STOMP communication.

      m is the message from the server given in the header. Usually, more information is provided in the body.

      Specified by:
      accept in interface BiConsumer<String, Message<String>>
      Parameters:
      m - the error message from the ERROR frame
      message - the complete ERROR frame message including headers and body
      Since:
      1.0.0