Skip to content

Commit 22de896

Browse files
committed
Merge branch '3.2.x'
Closes gh-39424
2 parents cc2233a + 36d850d commit 22de896

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/pulsar/PulsarPropertiesMapper.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.concurrent.TimeUnit;
2525
import java.util.function.BiConsumer;
2626
import java.util.function.Consumer;
27+
import java.util.stream.Collectors;
2728

2829
import org.apache.pulsar.client.admin.PulsarAdminBuilder;
2930
import org.apache.pulsar.client.api.Authentication;
@@ -36,7 +37,6 @@
3637
import org.apache.pulsar.client.api.ReaderBuilder;
3738
import org.apache.pulsar.client.api.ServiceUrlProvider;
3839
import org.apache.pulsar.client.impl.AutoClusterFailover.AutoClusterFailoverBuilderImpl;
39-
import org.apache.pulsar.common.util.ObjectMapperFactory;
4040

4141
import org.springframework.boot.context.properties.PropertyMapper;
4242
import org.springframework.pulsar.listener.PulsarContainerProperties;
@@ -133,7 +133,10 @@ private void customizeAuthentication(PulsarProperties.Authentication properties,
133133
private String getAuthenticationParamsJson(Map<String, String> params) {
134134
Map<String, String> sortedParams = new TreeMap<>(params);
135135
try {
136-
return ObjectMapperFactory.create().writeValueAsString(sortedParams);
136+
return sortedParams.entrySet()
137+
.stream()
138+
.map((e) -> "\"%s\":\"%s\"".formatted(e.getKey(), e.getValue()))
139+
.collect(Collectors.joining(",", "{", "}"));
137140
}
138141
catch (Exception ex) {
139142
throw new IllegalStateException("Could not convert auth parameters to encoded string", ex);

0 commit comments

Comments
 (0)