diff --git a/src/main/java/it/gov/pagopa/node/cfgsync/config/EventHubClientConfiguration.java b/src/main/java/it/gov/pagopa/node/cfgsync/config/EventHubClientConfiguration.java index 8c65f82..f5edab9 100644 --- a/src/main/java/it/gov/pagopa/node/cfgsync/config/EventHubClientConfiguration.java +++ b/src/main/java/it/gov/pagopa/node/cfgsync/config/EventHubClientConfiguration.java @@ -19,13 +19,15 @@ public class EventHubClientConfiguration { private static final String CONSUMER_GROUP = "$Default"; - private static final String STORAGE_ACCOUNT_CONNECTION_STRING = ""; - private static final String STORAGE_CONTAINER_NAME = "prova"; @Value("${nodo-dei-pagamenti-cache-rx-connection-string}") private String nodoCacheRxConnectionString; @Value("${nodo-dei-pagamenti-cache-rx-name}") private String nodoCacheRxName; + @Value("${nodo-dei-pagamenti-cache-sa-connection-string}") + private String nodoCacheSaConnectionString; + @Value("${nodo-dei-pagamenti-cache-sa-name}") + private String nodoCacheSaContainerName; @Bean EventHubClientBuilder eventHubClientBuilder() { @@ -34,8 +36,8 @@ EventHubClientBuilder eventHubClientBuilder() { @Bean BlobContainerClientBuilder blobContainerClientBuilder() { - return new BlobContainerClientBuilder().connectionString(STORAGE_ACCOUNT_CONNECTION_STRING) - .containerName(STORAGE_CONTAINER_NAME); + return new BlobContainerClientBuilder().connectionString(nodoCacheSaConnectionString) + .containerName(nodoCacheSaContainerName); } @Bean @@ -52,6 +54,11 @@ EventProcessorClientBuilder eventProcessorClientBuilder(BlobContainerAsyncClient .processError(EventHubClientConfiguration::processError); } + @Bean + EventProcessorClient eventProcessorClient(EventProcessorClientBuilder eventProcessorClientBuilder) { + return eventProcessorClientBuilder.buildEventProcessorClient(); + } + public static void processEvent(EventContext eventContext) { log.info("Processing event from partition {} with sequence number {} with body: {}", eventContext.getPartitionContext().getPartitionId(), eventContext.getEventData().getSequenceNumber(), diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 14f6431..e145278 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -24,6 +24,9 @@ service.stand-in-manager.subscriptionKey=${STAND-IN_MANAGER_SUBSCRIPTION_KEY} nodo-dei-pagamenti-cache-rx-connection-string=${NODO_CACHE_RX_CONNECTION_STRING} nodo-dei-pagamenti-cache-rx-name=nodo-dei-pagamenti-cache +nodo-dei-pagamenti-cache-sa-connection-string=${NODO_CACHE_SA_CONNECTION_STRING} +nodo-dei-pagamenti-cache-sa-name=prova + stand-in-rx-connection-string=${STAND-IN-MANAGER_RX_CONNECTION_STRING} stand-in-rx-name=nodo-dei-pagamenti-stand-in