From 52dad60337fac1fb00146c1d0a11f0ac0903f269 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 28 May 2020 14:22:18 +0200 Subject: [PATCH] GH-1950 Add scst_targetDestination header The core framework does nothing with this header other then defining it. One can always use StreamBridge for general cases Resolves #1950 --- .../cloud/stream/binder/BinderHeaders.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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