Skip to content

Commit 5c9d5e8

Browse files
committed
Only add quotes to channel name if required
1 parent e7482bf commit 5c9d5e8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

extensions/smallrye-reactive-messaging-kafka/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/kafka/deployment/SmallRyeReactiveMessagingKafkaProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ private static List<String> getChannelProperties(String keySuffix, Config config
124124
static String channelPropertyFormat = "mp.messaging.%s.%s.%s";
125125

126126
static String getChannelPropertyKey(String channelName, String propertyName, boolean incoming) {
127-
return String.format(channelPropertyFormat, incoming ? "incoming" : "outgoing",
128-
channelName.contains(".") ? "\"" + channelName + "\"" : channelName, propertyName);
127+
if ((channelName.charAt(0) != '"' || channelName.charAt(channelName.length() - 1) != '"')
128+
&& channelName.contains(".")) {
129+
channelName = "\"" + channelName + "\"";
130+
}
131+
return String.format(channelPropertyFormat, incoming ? "incoming" : "outgoing", channelName, propertyName);
129132
}
130133

131134
@BuildStep

0 commit comments

Comments
 (0)