Interface StreamOperations

All Known Implementing Classes:
StreamBridge

public interface StreamOperations
Basic contract for StreamBridge operations.
Since:
4.0.0
Author:
Oleg Zhurakousky, Soby Chacko
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    send(String bindingName, Object data)
    Sends 'data' to an output binding specified by 'bindingName' argument while using default content type to deal with output type conversion (if necessary).
    boolean
    send(String bindingName, Object data, org.springframework.util.MimeType outputContentType)
    Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary).
    boolean
    send(String bindingName, String binderName, Object data)
    Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary).
    boolean
    send(String bindingName, String binderName, Object data, org.springframework.util.MimeType outputContentType)
    Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary).
  • Method Details

    • send

      boolean send(String bindingName, Object data)
      Sends 'data' to an output binding specified by 'bindingName' argument while using default content type to deal with output type conversion (if necessary). For typical cases `bindingName` is configured using 'spring.cloud.stream.source' property. However, this operation also supports sending to truly dynamic destinations. This means if the name provided via 'bindingName' does not have a corresponding binding such name will be treated as dynamic destination.
      Will use default binder. For specific binder type see send(String, String, Object) and send(String, String, Object, MimeType) methods.
      Parameters:
      bindingName - the name of the output binding. That said it requires a bit of clarification. When using send("foo"...), the 'foo' typically represents the binding name. However, if such binding does not exist, the new binding will be created to support dynamic destinations.
      data - the data to send
      Returns:
      true if data was sent successfully, otherwise false or throws an exception.
    • send

      boolean send(String bindingName, Object data, org.springframework.util.MimeType outputContentType)
      Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary). For typical cases `bindingName` is configured using 'spring.cloud.stream.source' property. However, this operation also supports sending to truly dynamic destinations. This means if the name provided via 'bindingName' does not have a corresponding binding such name will be treated as dynamic destination.
      Will use default binder. For specific binder type see send(String, String, Object) and send(String, String, Object, MimeType) methods.
      Parameters:
      bindingName - the name of the output binding. That said it requires a bit of clarification. When using bridge.send("foo"...), the 'foo' typically represents the binding name. However, if such binding does not exist, the new binding will be created to support dynamic destinations.
      data - the data to send
      outputContentType - content type to be used to deal with output type conversion
      Returns:
      true if data was sent successfully, otherwise false or throws an exception.
    • send

      boolean send(String bindingName, @Nullable String binderName, Object data)
      Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary). For typical cases `bindingName` is configured using 'spring.cloud.stream.source' property. However, this operation also supports sending to truly dynamic destinations. This means if the name provided via 'bindingName' does not have a corresponding binding such name will be treated as dynamic destination.
      Parameters:
      bindingName - the name of the output binding. That said it requires a bit of clarification. When using bridge.send("foo"...), the 'foo' typically represents the binding name. However, if such binding does not exist, the new binding will be created to support dynamic destinations.
      binderName - the name of the binder to use (e.g., 'kafka', 'rabbit') for cases where multiple binders are used. Can be null.
      data - the data to send
      Returns:
      true if data was sent successfully, otherwise false or throws an exception.
    • send

      boolean send(String bindingName, @Nullable String binderName, Object data, org.springframework.util.MimeType outputContentType)
      Sends 'data' to an output binding specified by 'bindingName' argument while using the content type specified by the 'outputContentType' argument to deal with output type conversion (if necessary). For typical cases `bindingName` is configured using 'spring.cloud.stream.source' property. However, this operation also supports sending to truly dynamic destinations. This means if the name provided via 'bindingName' does not have a corresponding binding such name will be treated as dynamic destination.
      Parameters:
      bindingName - the name of the output binding. That said it requires a bit of clarification. When using bridge.send("foo"...), the 'foo' typically represents the binding name. However, if such binding does not exist, the new binding will be created to support dynamic destinations.
      binderName - the name of the binder to use (e.g., 'kafka', 'rabbit') for cases where multiple binders are used. Can be null.
      data - the data to send
      outputContentType - content type to be used to deal with output type conversion
      Returns:
      true if data was sent successfully, otherwise false or throws an exception.