Skip to content

Make BinderHeaders.BATCH_HEADERS final (fixes #3182)#3184

Open
wadhwaroh-lang wants to merge 1 commit intospring-cloud:mainfrom
wadhwaroh-lang:fix/3182-binder-headers-batch-final
Open

Make BinderHeaders.BATCH_HEADERS final (fixes #3182)#3184
wadhwaroh-lang wants to merge 1 commit intospring-cloud:mainfrom
wadhwaroh-lang:fix/3182-binder-headers-batch-final

Conversation

@wadhwaroh-lang
Copy link

Fixes #3182

Problem

BinderHeaders.BATCH_HEADERS is a public static String and is not final, so the header key could be reassigned by callers.

Solution

Mark BATCH_HEADERS as final, consistent with other constants in BinderHeaders (e.g. TARGET_DESTINATION, PARTITION_HEADER). This keeps the header name immutable and prevents accidental modification.

Changes

  • core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderHeaders.java: public static String BATCH_HEADERSpublic static final String BATCH_HEADERS

Signed-off-by: wadhwaroh-lang <wadhwa.roh@gmail.com>
@wadhwaroh-lang wadhwaroh-lang force-pushed the fix/3182-binder-headers-batch-final branch from 7de30a0 to a5c1e94 Compare March 15, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BinderHeaders.BATCH_HEADERS variable is not final

1 participant