Interface BridgePublishOutboundOutput

All Superinterfaces:
AsyncOutput<BridgePublishOutboundOutput>, SimpleAsyncOutput<BridgePublishOutboundOutput>

@DoNotImplement public interface BridgePublishOutboundOutput extends AsyncOutput<BridgePublishOutboundOutput>
This is the output parameter of any BridgePublishOutboundInterceptor providing methods to define the outcome of PUBLISH interception.

It can be used to

  • Modify an outbound PUBLISH packet
  • Prevent delivery of an outbound PUBLISH packet
Since:
Edge 2023.1
  • Method Details

    • getPublishPacket

      @NotNull @NotNull ModifiableOutboundPublish getPublishPacket()
      Use this object to make any changes to the outbound PUBLISH.
      Returns:
      A modifiable publish packet.
      Since:
      Edge 2023.1
    • preventPublishDelivery

      void preventPublishDelivery()
      Prevent the onward delivery of the PUBLISH packet.
      Throws:
      UnsupportedOperationException - When preventPublishDelivery is called more than once.
      Since:
      Edge 2023.1
    • async

      @NotNull @NotNull Async<BridgePublishOutboundOutput> async(@NotNull @NotNull Duration timeout, @NotNull @NotNull TimeoutFallback timeoutFallback)
      If the timeout is expired before Async.resume() is called then the outcome is handled either as failed or successful, depending on the specified fallback.

      Do not call this method more than once. If an async method is called multiple times an exception is thrown.

      Specified by:
      async in interface AsyncOutput<BridgePublishOutboundOutput>
      Parameters:
      timeout - Timeout that HiveMQ waits for the result of the async operation.
      timeoutFallback - Fallback behaviour if a timeout occurs. If the fallback is SUCCESS then the publish will be delivered. If the fallback is FAILURE then the publish will be dropped.
      Throws:
      UnsupportedOperationException - If async is called more than once.
      NullPointerException - If timeout or timeoutFallback is null.
      Since:
      Edge 2023.1