Skip to content

Commit

Permalink
NOD-690: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fparisitas committed Feb 8, 2024
1 parent e902d7a commit ee7d9fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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(),
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ee7d9fa

Please sign in to comment.