|
32 | 32 | import org.springframework.core.type.AnnotationMetadata;
|
33 | 33 | import org.springframework.integration.support.management.metrics.MetricsCaptor;
|
34 | 34 | import org.springframework.util.Assert;
|
| 35 | +import org.springframework.util.StringUtils; |
35 | 36 |
|
36 | 37 | import io.micrometer.observation.ObservationRegistry;
|
37 |
| -import org.springframework.util.StringUtils; |
38 | 38 |
|
39 | 39 | /**
|
40 | 40 | * {@code @Configuration} class that registers a {@link IntegrationManagementConfigurer} bean.
|
|
44 | 44 | *
|
45 | 45 | * @author Artem Bilan
|
46 | 46 | * @author Gary Russell
|
47 |
| - * |
48 | 47 | * @since 4.2
|
49 | 48 | */
|
50 | 49 | @Configuration(proxyBeanMethods = false)
|
@@ -87,13 +86,18 @@ public IntegrationManagementConfigurer managementConfigurer(
|
87 | 86 | }
|
88 | 87 |
|
89 | 88 | private String[] obtainObservationPatterns() {
|
90 |
| - Set<String> patterns = new HashSet<>(); |
91 |
| - String[] observationPatterns = (String[]) this.attributes.get("observationPatterns"); |
92 |
| - for (String observationPattern : observationPatterns) { |
93 |
| - String pattern = this.environment.resolvePlaceholders(observationPattern); |
94 |
| - patterns.addAll(StringUtils.commaDelimitedListToSet(pattern)); |
| 89 | + Set<String> observationPatterns = new HashSet<>(); |
| 90 | + String[] patternsProperties = (String[]) this.attributes.get("observationPatterns"); |
| 91 | + for (String patternProperty : patternsProperties) { |
| 92 | + String patternValue = this.environment.resolvePlaceholders(patternProperty); |
| 93 | + String[] patternsToProcess = StringUtils.commaDelimitedListToStringArray(patternValue); |
| 94 | + for (String pattern : patternsToProcess) { |
| 95 | + if (StringUtils.hasText(pattern)) { |
| 96 | + observationPatterns.add(pattern); |
| 97 | + } |
| 98 | + } |
95 | 99 | }
|
96 |
| - return patterns.toArray(new String[0]); |
| 100 | + return observationPatterns.toArray(new String[0]); |
97 | 101 | }
|
98 | 102 |
|
99 | 103 | }
|
0 commit comments