|
6 | 6 | import com.azure.messaging.eventhubs.EventHubClientBuilder; |
7 | 7 | import com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore; |
8 | 8 | import com.azure.spring.cloud.autoconfigure.implementation.eventhubs.properties.AzureEventHubsProperties; |
9 | | -import com.azure.spring.cloud.core.implementation.util.AzureSpringIdentifier; |
10 | 9 | import com.azure.spring.cloud.core.customizer.AzureServiceClientBuilderCustomizer; |
| 10 | +import com.azure.spring.cloud.core.implementation.util.AzureSpringIdentifier; |
11 | 11 | import com.azure.spring.cloud.service.implementation.storage.blob.BlobServiceClientBuilderFactory; |
12 | 12 | import com.azure.storage.blob.BlobContainerAsyncClient; |
13 | 13 | import com.azure.storage.blob.BlobServiceClientBuilder; |
14 | 14 | import org.slf4j.Logger; |
15 | 15 | import org.slf4j.LoggerFactory; |
16 | | -import org.springframework.beans.BeanUtils; |
17 | 16 | import org.springframework.beans.factory.ObjectProvider; |
18 | 17 | import org.springframework.beans.factory.annotation.Qualifier; |
19 | 18 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
|
26 | 25 |
|
27 | 26 | import static com.azure.spring.cloud.autoconfigure.context.AzureContextUtils.EVENT_HUB_PROCESSOR_CHECKPOINT_STORE_STORAGE_CLIENT_BUILDER_BEAN_NAME; |
28 | 27 | import static com.azure.spring.cloud.autoconfigure.context.AzureContextUtils.EVENT_HUB_PROCESSOR_CHECKPOINT_STORE_STORAGE_CLIENT_BUILDER_FACTORY_BEAN_NAME; |
29 | | -import static com.azure.spring.cloud.core.implementation.util.AzurePropertiesUtils.mergeAzureCommonProperties; |
30 | 28 |
|
31 | 29 | /** |
32 | 30 | * Configures a {@link BlobCheckpointStore} |
@@ -83,25 +81,11 @@ BlobServiceClientBuilderFactory eventHubProcessorBlobServiceClientBuilderFactory |
83 | 81 | AzureEventHubsProperties eventHubsProperties, |
84 | 82 | ObjectProvider<AzureServiceClientBuilderCustomizer<BlobServiceClientBuilder>> customizers) { |
85 | 83 | BlobServiceClientBuilderFactory factory = |
86 | | - new BlobServiceClientBuilderFactory(getCheckpointStoreProperties(eventHubsProperties)); |
| 84 | + new BlobServiceClientBuilderFactory(eventHubsProperties.buildProcessorProperties().getCheckpointStore()); |
87 | 85 |
|
88 | 86 | factory.setSpringIdentifier(AzureSpringIdentifier.AZURE_SPRING_EVENT_HUBS); |
89 | 87 | customizers.orderedStream().forEach(factory::addBuilderCustomizer); |
90 | 88 | return factory; |
91 | 89 | } |
92 | 90 |
|
93 | | - private AzureEventHubsProperties.Processor.BlobCheckpointStore getCheckpointStoreProperties( |
94 | | - AzureEventHubsProperties ehProperties) { |
95 | | - |
96 | | - AzureEventHubsProperties.Processor.BlobCheckpointStore result = new AzureEventHubsProperties.Processor |
97 | | - .BlobCheckpointStore(); |
98 | | - AzureEventHubsProperties.Processor.BlobCheckpointStore csProperties = ehProperties.getProcessor() |
99 | | - .getCheckpointStore(); |
100 | | - |
101 | | - mergeAzureCommonProperties(ehProperties, csProperties, result); |
102 | | - BeanUtils.copyProperties(csProperties, result); |
103 | | - |
104 | | - return result; |
105 | | - } |
106 | | - |
107 | 91 | } |
0 commit comments