Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagopa 1695 sviluppo pa send rt long term reliability #102

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
df0163a
PAGOPA-1695 wip
FedericoRuzzier Apr 17, 2024
4b7da60
PAGOPA-1695 wip handling xml
FedericoRuzzier Apr 18, 2024
0d126f8
PAGOPA-1695 wip
FedericoRuzzier Apr 19, 2024
805681c
PAGOPA-1695 wip fixing logic and junit
FedericoRuzzier Apr 23, 2024
6cc83a0
PAGOPA-1695 adding scheduler class
FedericoRuzzier Apr 23, 2024
579fb63
PAGOPA-1695 updating logic and inserting junit tests
FedericoRuzzier Apr 30, 2024
d6c6224
PAGOPA-1695 solving some issues
FedericoRuzzier May 6, 2024
429d5d1
PAGOPA-1695 fixing junit
FedericoRuzzier May 6, 2024
7dbd3f4
PAGOPA-1695 adding xml validation
FedericoRuzzier May 7, 2024
9107947
PAGOPA-1695 testing security
FedericoRuzzier May 7, 2024
1e178fa
PAGOPA-1695 changing documentbuilderfactory
FedericoRuzzier May 7, 2024
2818c44
PAGOPA-1695 adding values for kubernetes
FedericoRuzzier May 7, 2024
2792bc6
Merge branch 'main' into PAGOPA-1695-sviluppo-pa-send-rt-long-term-re…
FedericoRuzzier May 7, 2024
1560c35
PAGOPA-1695 update local properties file
FedericoRuzzier May 7, 2024
0f2e5db
PAGOPA-1695 update helm value
FedericoRuzzier May 7, 2024
db4cb6b
PAGOPA-1695 update properties file
FedericoRuzzier May 7, 2024
4f22564
PAGOPA-1695 minor fix
FedericoRuzzier May 7, 2024
384034b
PAGOPA-1695 minor fix
FedericoRuzzier May 7, 2024
1dccd1f
PAGOPA-1695 minor fix
FedericoRuzzier May 7, 2024
d42ef65
PAGOPA-1695 fixing comments
FedericoRuzzier May 7, 2024
7740bcd
[PAGOPA-1695] chore: Update log
cap-ang May 8, 2024
8c59dbc
Bump to version 0.12.21-1-PAGOPA-1695-sviluppo-pa-send-rt-long-term-r…
pagopa-github-bot May 8, 2024
518a98e
PAGOPA-1695 fixing scheduler job
FedericoRuzzier May 8, 2024
a599a7a
Bump to version 0.12.21-2-PAGOPA-1695-sviluppo-pa-send-rt-long-term-r…
pagopa-github-bot May 8, 2024
d653c33
PAGOPA-1695 adding catch in scheduler
FedericoRuzzier May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
813 changes: 387 additions & 426 deletions openapi/openapi.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@
<version>2.1.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.20.2</version>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package it.gov.pagopa.payments.config;

import com.azure.storage.queue.QueueClient;
import com.azure.storage.queue.QueueClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class QueueClientConfiguration {

private static String QUEUE_NAME;

private static String CONNECTION_STRING;

@Value("${azure.queue.connection.string}")
public void setConnectionStringStatic(String connectionString) {
QueueClientConfiguration.CONNECTION_STRING = connectionString;
}

@Value("${azure.queue.queueName}")
public void setTableNameStatic(String queueName) {
QueueClientConfiguration.QUEUE_NAME = queueName;
}

@Bean
public QueueClient queueClientConfig(){
return new QueueClientBuilder()
.queueName(QUEUE_NAME)
.connectionString(CONNECTION_STRING)
.buildClient();
}
}
36 changes: 36 additions & 0 deletions src/main/java/it/gov/pagopa/payments/scheduler/Scheduler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package it.gov.pagopa.payments.scheduler;

import it.gov.pagopa.payments.service.SchedulerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Component
@Slf4j
@ConditionalOnProperty(name = "cron.job.schedule.retry.enabled", matchIfMissing = true)
public class Scheduler {

private static final String LOG_BASE_HEADER_INFO = "[OperationType: %s] - [ClassMethod: %s] - [MethodParamsToLog: %s]";
private static final String CRON_JOB = "CRON JOB";
private Thread threadOfExecution;

@Autowired
SchedulerService schedulerService;

@Scheduled(cron = "${cron.job.schedule.expression.retry.status}")
@Async
@Transactional
FedericoRuzzier marked this conversation as resolved.
Show resolved Hide resolved
public void changeDebtPositionStatusToValid() {
log.info(String.format(LOG_BASE_HEADER_INFO, CRON_JOB, "retry sendRT", "Running at " + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").format(LocalDateTime.now())));
schedulerService.getAllFailuresQueue();
this.threadOfExecution = Thread.currentThread();
}
}

Loading
Loading