接口 MessageChannel

    • 字段概要

      字段 
      修饰符和类型字段说明
      static longINDEFINITE_TIMEOUT
      Constant for sending a message without a prescribed timeout.
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      booleansend​(Message<?> message)
      Send a Message to this channel.
      booleansend​(Message<?> message, long timeout)
      Send a message, blocking until either the message is accepted or the specified timeout period elapses.
    • 方法详细资料

      • send

        boolean send​(Message<?> message)
        Send a Message to this channel. If the message is sent successfully, the method returns true. If the message cannot be sent due to a non-fatal reason, the method returns false. The method may also throw a RuntimeException in case of non-recoverable errors.

        This method may block indefinitely, depending on the implementation. To provide a maximum wait time, use send(Message, long).

        参数:
        message - the message to send
        返回:
        whether or not the message was sent
      • send

        boolean send​(Message<?> message,
                     long timeout)
        Send a message, blocking until either the message is accepted or the specified timeout period elapses.
        参数:
        message - the message to send
        timeout - the timeout in milliseconds or INDEFINITE_TIMEOUT
        返回:
        true if the message is sent, false if not including a timeout of an interrupt of the send