From cf470b6d6f6b923e8a91469ed05e537646e92ba4 Mon Sep 17 00:00:00 2001 From: Ilayaperumal Gopinathan Date: Thu, 27 Aug 2015 08:16:41 -0700 Subject: [PATCH] Make binding key case insensitive - Use `TreeMap` for channel bindings and set case insensitive comparator for the tree map. - This way binding key (typically channel name) can be looked up case insensitively --- .../cloud/stream/config/ChannelBindingProperties.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java index 673721e9a..273792b6d 100644 --- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java +++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/ChannelBindingProperties.java @@ -16,11 +16,10 @@ package org.springframework.cloud.stream.config; -import java.util.HashMap; import java.util.Map; import java.util.Properties; +import java.util.TreeMap; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties; import com.fasterxml.jackson.annotation.JsonInclude; @@ -40,7 +39,7 @@ public class ChannelBindingProperties { private Properties producerProperties = new Properties(); - private Map bindings = new HashMap<>(); + private Map bindings = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); public Properties getConsumerProperties() { return this.consumerProperties;