|
23 | 23 | import java.util.concurrent.TimeUnit;
|
24 | 24 | import java.util.function.BiConsumer;
|
25 | 25 | import java.util.function.Consumer;
|
| 26 | +import java.util.stream.Collectors; |
26 | 27 |
|
27 | 28 | import org.apache.pulsar.client.admin.PulsarAdminBuilder;
|
28 | 29 | import org.apache.pulsar.client.api.ClientBuilder;
|
29 | 30 | import org.apache.pulsar.client.api.ConsumerBuilder;
|
30 | 31 | import org.apache.pulsar.client.api.ProducerBuilder;
|
31 | 32 | import org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException;
|
32 | 33 | import org.apache.pulsar.client.api.ReaderBuilder;
|
33 |
| -import org.apache.pulsar.common.util.ObjectMapperFactory; |
34 | 34 |
|
35 | 35 | import org.springframework.boot.context.properties.PropertyMapper;
|
36 | 36 | import org.springframework.pulsar.listener.PulsarContainerProperties;
|
@@ -87,7 +87,10 @@ private void customizeAuthentication(AuthenticationConsumer authentication,
|
87 | 87 | private String getAuthenticationParamsJson(Map<String, String> params) {
|
88 | 88 | Map<String, String> sortedParams = new TreeMap<>(params);
|
89 | 89 | try {
|
90 |
| - return ObjectMapperFactory.create().writeValueAsString(sortedParams); |
| 90 | + return sortedParams.entrySet() |
| 91 | + .stream() |
| 92 | + .map((e) -> "\"%s\":\"%s\"".formatted(e.getKey(), e.getValue())) |
| 93 | + .collect(Collectors.joining(",", "{", "}")); |
91 | 94 | }
|
92 | 95 | catch (Exception ex) {
|
93 | 96 | throw new IllegalStateException("Could not convert auth parameters to encoded string", ex);
|
|
0 commit comments