Merge branch 'feature/25-integrate-apache-camel' into 'develop/0.2.0'
integrate apache camel Closes #25 and #26 See merge request tpeetz/kontor!29
This commit was merged in pull request #73.
This commit is contained in:
+3
-66
@@ -54,73 +54,12 @@ services:
|
||||
- frontend
|
||||
volumes:
|
||||
- activemq-data:/var/lib/artemis-instance
|
||||
karavan:
|
||||
container_name: karavan
|
||||
image: ghcr.io/apache/camel-karavan:4.10.2
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- KARAVAN_GIT_REPOSITORY=http://gitea:3000/karavan/karavan.git
|
||||
- KARAVAN_GIT_USERNAME=tpeetz
|
||||
- KARAVAN_GIT_PASSWORD=04ibtp-0121AWS42
|
||||
- KARAVAN_GIT_BRANCH=main
|
||||
- KARAVAN_CONTAINER_IMAGE_REGISTRY=registry:5000
|
||||
- KARAVAN_CONTAINER_IMAGE_REGISTRY_USERNAME=
|
||||
- KARAVAN_CONTAINER_IMAGE_REGISTRY_PASSWORD=
|
||||
- KARAVAN_GIT_INSTALL_GITEA=true
|
||||
- KARAVAN_CONTAINER_IMAGE_REGISTRY=registry:5000
|
||||
- KARAVAN_CONTAINER_IMAGE_GROUP=karavan
|
||||
- KARAVAN_DOCKER_NETWORK=karavan
|
||||
ports:
|
||||
- 8880:8080
|
||||
networks:
|
||||
- karavan
|
||||
- database
|
||||
- integration
|
||||
- frontend
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /home/tpeetz/.m2:/opt/.m2
|
||||
labels:
|
||||
- "org.apache.camel.karavan/type=internal"
|
||||
depends_on:
|
||||
gitea:
|
||||
condition: service_healthy
|
||||
restart: true
|
||||
registry:
|
||||
container_name: registry
|
||||
image: registry:2
|
||||
restart: always
|
||||
ports:
|
||||
- 5555:5000
|
||||
labels:
|
||||
- "org.apache.camel.karavan/type=internal"
|
||||
networks:
|
||||
- karavan
|
||||
gitea:
|
||||
container_name: gitea
|
||||
image: gitea/gitea:1.21.6-rootless
|
||||
restart: always
|
||||
ports:
|
||||
- "4000:3000"
|
||||
volumes:
|
||||
- gitea-data:/var/lib/gitea
|
||||
- gitea-config:/etc/gitea
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://gitea:3000/api/healthz"]
|
||||
interval: 1m
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
labels:
|
||||
- "org.apache.camel.karavan/type=internal"
|
||||
networks:
|
||||
- karavan
|
||||
- frontend
|
||||
kontor:
|
||||
image: kontor:0.2.0-SNAPSHOT
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- database
|
||||
- integration
|
||||
- frontend
|
||||
ports:
|
||||
- 8000:8000
|
||||
@@ -134,6 +73,7 @@ services:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- database
|
||||
- integration
|
||||
- frontend
|
||||
ports:
|
||||
- 8800:8800
|
||||
@@ -145,15 +85,12 @@ services:
|
||||
networks:
|
||||
database:
|
||||
integration:
|
||||
karavan:
|
||||
name: karavan
|
||||
name: integration
|
||||
frontend:
|
||||
volumes:
|
||||
postgres-data:
|
||||
couchdb-data:
|
||||
activemq-data:
|
||||
gitea-data:
|
||||
gitea-config:
|
||||
images-data:
|
||||
secrets:
|
||||
db-password:
|
||||
|
||||
@@ -54,9 +54,14 @@ configurations {
|
||||
dependencies {
|
||||
implementation 'com.vaadin:vaadin-core'
|
||||
implementation 'com.vaadin:vaadin-spring-boot-starter'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-artemis'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.apache.camel.springboot:camel-spring-boot-starter'
|
||||
implementation 'org.apache.camel.springboot:camel-jms-starter'
|
||||
implementation 'org.apache.activemq:artemis-jakarta-client'
|
||||
//implementation libs.artemis
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
implementation 'io.micrometer:micrometer-registry-prometheus'
|
||||
@@ -78,6 +83,7 @@ dependencies {
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
testImplementation 'com.vaadin:vaadin-testbench-junit5'
|
||||
testImplementation 'io.projectreactor:reactor-test'
|
||||
testImplementation 'org.apache.camel:camel-test-spring-junit5'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
@@ -145,6 +151,7 @@ build.dependsOn asciidoctorPdf
|
||||
dependencyManagement {
|
||||
imports {
|
||||
mavenBom libs.vaadin.bom.get().toString()
|
||||
mavenBom libs.camel.bom.get().toString()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ cimtConventions = "1.0.0-SNAPSHOT"
|
||||
springboot = "3.2.5"
|
||||
springdependencies = "1.1.4"
|
||||
vaadin = "24.3.8"
|
||||
camel = "4.10.6"
|
||||
artemis = "2.41.0"
|
||||
lombok = "8.6"
|
||||
gson = "2.9.0"
|
||||
jackson = "2.16.1"
|
||||
@@ -43,6 +45,8 @@ mail = { module = "com.sun.mail:javax.mail", version.ref ="mail" }
|
||||
sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version.ref = "sqlite" }
|
||||
hypersistence = { module = "io.hypersistence:hypersistence-utils-hibernate-63", version.ref = "hypersistence" }
|
||||
vaadin-bom = { module = "com.vaadin:vaadin-bom", version.ref = "vaadin" }
|
||||
camel-bom = { module = "org.apache.camel.springboot:camel-spring-boot-bom", version.ref = "camel"}
|
||||
artemis = { module = "org.apache.activemq:artemis-jms-server", version.ref = "artemis" }
|
||||
asciidoctorGradleJvmGems = { module = "org.asciidoctor:asciidoctor-gradle-jvm-gems", version.ref= "asciidoctor" }
|
||||
asciidoctorGradleJvm = { module = "org.asciidoctor:asciidoctor-gradle-jvm", version.ref= "asciidoctor" }
|
||||
asciidoctorGradleJvmPdf = { module = "org.asciidoctor:asciidoctor-gradle-jvm-pdf", version.ref= "asciidoctor" }
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package de.thpeetz.kontor.integration;
|
||||
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ReadQueueRoute extends RouteBuilder {
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
from("jms:queue:KontorMediaFile")
|
||||
.log("${body}");
|
||||
}
|
||||
}
|
||||
@@ -24,14 +24,23 @@ spring:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
camel:
|
||||
cloud:
|
||||
enabled: true
|
||||
springboot:
|
||||
routes-reload-enabled: true
|
||||
routes-reload-directory: routes
|
||||
routes-relaod-pattern: "*.xml"
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
include: health,info,metrics,prometheus,camelroutes
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
probes:
|
||||
enabled: true
|
||||
prometheus:
|
||||
enabled: true
|
||||
logging:
|
||||
@@ -41,6 +50,10 @@ logging:
|
||||
hibernate: INFO
|
||||
springframework:
|
||||
web: INFO
|
||||
jms: DEBUG
|
||||
apache:
|
||||
activemq:
|
||||
artemis: DEBUG
|
||||
guru:
|
||||
springframework:
|
||||
controllers: DEBUG
|
||||
@@ -63,6 +76,11 @@ spring:
|
||||
url: jdbc:postgresql://postgres:5432/kontor
|
||||
username: 'kontor'
|
||||
password: 'kontor'
|
||||
artemis:
|
||||
mode: native
|
||||
broker-url: tcp://activemq:61616
|
||||
user: artemis
|
||||
password: artemis
|
||||
server:
|
||||
port: 8000
|
||||
---
|
||||
@@ -76,5 +94,10 @@ spring:
|
||||
url: jdbc:postgresql://localhost:5432/kontor
|
||||
username: kontor
|
||||
password: kontor
|
||||
artemis:
|
||||
mode: native
|
||||
broker-url: tcp://localhost:61616
|
||||
user: artemis
|
||||
password: artemis
|
||||
server:
|
||||
port: 8085
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
package de.thpeetz.kontor;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@SpringBootTest
|
||||
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
|
||||
import org.apache.camel.CamelContext;
|
||||
import org.apache.camel.builder.NotifyBuilder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
|
||||
@CamelSpringBootTest
|
||||
@SpringBootTest(classes = Application.class)
|
||||
class ApplicationTests {
|
||||
@Autowired
|
||||
private CamelContext camelContext;
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void shouldProduceMessages() throws Exception {
|
||||
NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();
|
||||
assertTrue(notify.matches(10, TimeUnit.SECONDS));
|
||||
}
|
||||
@Test
|
||||
void contextLoads() {
|
||||
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
package de.thpeetz.kontor.media.services;
|
||||
|
||||
import de.thpeetz.kontor.common.views.SearchFilter;
|
||||
import de.thpeetz.kontor.media.TestConstants;
|
||||
import de.thpeetz.kontor.media.data.MediaFile;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
@@ -40,7 +41,9 @@ public class MediaFileServiceTest {
|
||||
@Order(3)
|
||||
void testDeleteMediaFile() {
|
||||
int mediaFileCount = mediaFileService.findAllMediaFiles(null).size();
|
||||
List<MediaFile> mediaFileList = mediaFileService.findAllMediaFiles(TestConstants.URL);
|
||||
SearchFilter searchFilter = new SearchFilter();
|
||||
searchFilter.setSearchTerm(TestConstants.URL);
|
||||
List<MediaFile> mediaFileList = mediaFileService.findAllMediaFiles(searchFilter);
|
||||
assertEquals(1, mediaFileList.size());
|
||||
mediaFileService.deleteMediaFile(mediaFileList.get(0));
|
||||
assertEquals(--mediaFileCount, mediaFileService.findAllMediaFiles(null).size());
|
||||
|
||||
Reference in New Issue
Block a user