Skip to content

Commit 1572d24

Browse files
committed
Divisione adapter mongo e postgresql, configurazione profilo kube, salvataggio cambio stato quando viene inviata una annotazione e script per test automatici
1 parent afdc9b1 commit 1572d24

File tree

87 files changed

+1810
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1810
-491
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ COPY core/pom.xml core/
1818
COPY adapter-api/pom.xml adapter-api/
1919
COPY adapter-web/pom.xml adapter-web/
2020
COPY adapter-aws/pom.xml adapter-aws/
21-
COPY adapter-onprem/pom.xml adapter-onprem/
21+
COPY adapter-mongodb/pom.xml adapter-mongodb/
22+
COPY adapter-postgresql/pom.xml adapter-postgresql/
2223
COPY adapter-sqlite/pom.xml adapter-sqlite/
2324
COPY adapter-kafka/pom.xml adapter-kafka/
2425
COPY adapter-azure/pom.xml adapter-azure/
@@ -79,7 +80,7 @@ EXPOSE 8080
7980

8081
# Variabili d'ambiente
8182
ENV JAVA_OPTS="-Xms256m -Xmx512m -XX:+UseG1GC"
82-
ENV SPRING_PROFILES_ACTIVE=onprem
83+
ENV SPRING_PROFILES_ACTIVE=kube
8384

8485
# Health check
8586
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \

README.md

Lines changed: 36 additions & 123 deletions
Large diffs are not rendered by default.

adapter-kafka/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Adapter Kafka
22

3-
Questo modulo implementa l'invio delle annotazioni tramite Apache Kafka per il profilo `onprem`.
3+
Questo modulo implementa l'invio delle annotazioni tramite Apache Kafka per il profilo `kube`.
44

55
## Funzionalità
66

@@ -11,7 +11,7 @@ Questo modulo implementa l'invio delle annotazioni tramite Apache Kafka per il p
1111

1212
## Configurazione
1313

14-
Nel file `application-onprem.yml`:
14+
Nel file `application-xxxx.yml`:
1515

1616
```yaml
1717
annotazione:
@@ -31,7 +31,7 @@ annotazione:
3131
## Profilo di attivazione
3232

3333
Questo adapter viene attivato automaticamente quando:
34-
- Il profilo Spring attivo è `onprem`
34+
- Il profilo Spring attivo è `kube`
3535
- La configurazione `annotazione.invio.enabled=true`
3636

3737
## Dipendenze principali

adapter-kafka/src/main/java/it/alnao/springbootexample/kafka/config/KafkaConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.util.Map;
1515

1616
@Configuration
17-
@Profile("onprem")
17+
@Profile("kube")
1818
public class KafkaConfig {
1919

2020
private final AnnotazioneInvioProperties properties;

adapter-kafka/src/main/java/it/alnao/springbootexample/kafka/service/KafkaAnnotazioneInvioService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.concurrent.CompletableFuture;
2222

2323
@Service
24-
@Profile("onprem")
24+
@Profile("kube")
2525
public class KafkaAnnotazioneInvioService implements AnnotazioneInvioService {
2626

2727
private static final Logger logger = LoggerFactory.getLogger(KafkaAnnotazioneInvioService.class);

adapter-mongodb/pom.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
5+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
<modelVersion>4.0.0</modelVersion>
7+
8+
<version>0.0.2</version>
9+
10+
<parent>
11+
<groupId>it.alnao.springbootexample</groupId>
12+
<artifactId>springbootexample-parent</artifactId>
13+
<version>0.0.2</version>
14+
</parent>
15+
<artifactId>adapter-mongodb</artifactId>
16+
<name>Gestione annotazioni - MongoDB adapter</name>
17+
<description>Implementazione MongoDB per Kubernetes</description>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>it.alnao.springbootexample</groupId>
22+
<artifactId>core</artifactId>
23+
</dependency>
24+
25+
<dependency>
26+
<groupId>org.springframework.boot</groupId>
27+
<artifactId>spring-boot-starter-data-mongodb</artifactId>
28+
</dependency>
29+
30+
<!-- Test dependencies -->
31+
<dependency>
32+
<groupId>org.mockito</groupId>
33+
<artifactId>mockito-core</artifactId>
34+
<scope>test</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.mockito</groupId>
38+
<artifactId>mockito-junit-jupiter</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.junit.jupiter</groupId>
43+
<artifactId>junit-jupiter</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.jacoco</groupId>
52+
<artifactId>jacoco-maven-plugin</artifactId>
53+
<version>0.8.11</version>
54+
<executions>
55+
<execution>
56+
<goals>
57+
<goal>prepare-agent</goal>
58+
</goals>
59+
</execution>
60+
<execution>
61+
<id>report</id>
62+
<phase>verify</phase>
63+
<goals>
64+
<goal>report</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
69+
</plugins>
70+
</build>
71+
</project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package it.alnao.springbootexample.mongodb.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.context.annotation.Profile;
5+
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
6+
7+
@Configuration
8+
@Profile("kube")
9+
@EnableMongoRepositories(basePackages = "it.alnao.springbootexample.mongodb.repository")
10+
public class MongoDBConfiguration {
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package it.alnao.springbootexample.onprem.entity;
1+
package it.alnao.springbootexample.mongodb.entity;
22

33
import org.springframework.data.annotation.Id;
44
import org.springframework.data.mongodb.core.mapping.Document;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package it.alnao.springbootexample.onprem.entity;
1+
package it.alnao.springbootexample.mongodb.entity;
22

33
import org.springframework.data.annotation.Id;
44
import org.springframework.data.mongodb.core.mapping.Document;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package it.alnao.springbootexample.onprem.entity;
1+
package it.alnao.springbootexample.mongodb.entity;
22

33
import org.springframework.data.annotation.Id;
44
import org.springframework.data.mongodb.core.mapping.Document;

0 commit comments

Comments
 (0)