diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderHeaders.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderHeaders.java index 0d844f521..515b4147a 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderHeaders.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderHeaders.java @@ -16,6 +16,7 @@ package org.springframework.cloud.stream.binder; +import org.springframework.cloud.stream.function.StreamBridge; import org.springframework.integration.IntegrationMessageHeaderAccessor; import org.springframework.messaging.MessageHeaders; @@ -39,6 +40,18 @@ public final class BinderHeaders { private static final String PREFIX = "scst_"; + /** + * Indicates the name of the target destination the binder should use if they + * choose (or have capabilities) to optimize sending output messages to + * dynamic destinations. + *
+ *
+ * NOTE: The core framework only defines this header, but does nothing else. + * So it is up to binders to choose to support it or not. One can always rely on {@link StreamBridge} + * for general cases of sending output messages to dynamic destinations. + */ + public static final String TARGET_DESTINATION = PREFIX + "targetDestination"; + /** * Indicates the target partition of an outbound message. Binders must observe this * value when sending data on the transport. This header is internally set by the