v3.0.0 Setting base work for html testing

prototype
Yan 5 days ago
parent 7c89a6361e
commit b5c8890bfb

@ -1,11 +1,11 @@
meta {
name: findUser
name: findSession
type: http
seq: 4
}
get {
url: http://localhost:9091/services/api/user/2
url: http://localhost:9090/services/api/session/a3518555-5a96-42a6-a5ec-958c4963a65e
body: none
auth: basic
}

@ -1,11 +1,11 @@
meta {
name: findUsers
name: findSessions
type: http
seq: 2
}
get {
url: http://localhost:9091/services/api/user
url: http://localhost:9090/services/api/session
body: none
auth: basic
}

@ -0,0 +1,20 @@
meta {
name: login
type: http
seq: 5
}
post {
url: http://localhost:9090/services/api/login/a3518555-5a96-42a6-a5ec-958c4963a65e
body: none
auth: basic
}
headers {
operationName: findUsers
}
auth:basic {
username: cxfrs
password: password
}

@ -0,0 +1,33 @@
meta {
name: updateSession
type: http
seq: 3
}
post {
url: http://localhost:9090/services/api/session
body: json
auth: basic
}
headers {
Content-Type: application/json
X-MethodName: updateUser
}
auth:basic {
username: cxfrs
password: password
}
body:json {
{
"sessionId": "{{uuid}}",
"username": "admin1",
"password": "password1"
}
}
script:pre-request {
bru.setVar('uuid', require("uuid").v4());
}

@ -1,28 +0,0 @@
meta {
name: updateUser
type: http
seq: 3
}
post {
url: http://localhost:9091/services/api/user
body: json
auth: basic
}
headers {
Content-Type: application/json
X-MethodName: updateUser
}
auth:basic {
username: cxfrs
password: password
}
body:json {
{
"id": 4,
"name": "Diana Themyscira"
}
}

@ -15,10 +15,7 @@ spring:
password: secret
app:
queue-name: "UserServiceQueue"
zookeeper:
url: "127.0.0.1:2181"
group-name: "UserServiceGroup"
queue-name: "SessionServiceQueue"
database:
url: "jdbc:h2:tcp://localhost/~/h2/db/appdb"
username: "app"

@ -15,10 +15,7 @@ spring:
password: secret
app:
queue-name: "UserServiceQueue"
zookeeper:
url: "127.0.0.1:2181"
group-name: "UserServiceGroup"
queue-name: "SessionServiceQueue"
database:
url: "jdbc:h2:tcp://localhost/~/h2/db/appdb"
username: "app"

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>camel-springboot-activemq6-example</artifactId>
<version>2.1.2</version>
<version>3.0.0</version>
<name>camel-springboot-activemq6-example</name>
<parent>
<groupId>org.springframework.boot</groupId>
@ -19,6 +19,8 @@
<springboot.version>${project.parent.version}</springboot.version>
<mybatis.version>3.5.19</mybatis.version>
<mybatis-spring.version>3.0.4</mybatis-spring.version>
<htmlunit.version>4.11.1</htmlunit.version>
<guava.version>33.1.0-jre</guava.version>
</properties>
<dependencyManagement>
@ -89,11 +91,19 @@
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-zookeeper-master-starter</artifactId>
<artifactId>camel-mybatis-starter</artifactId>
</dependency>
<!-- Other -->
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-mybatis-starter</artifactId>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>org.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>${htmlunit.version}</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
@ -118,6 +128,10 @@
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
<build>
<plugins>

@ -5,7 +5,6 @@
```
ApacheDS Server 2.0.0.AM27
Apache ActiveMQ 6.1.5
Apache Zookeeper 3.9.3
H2 Database Version 2.3.232
```
@ -96,119 +95,7 @@ Loading message broker from: xbean:activemq.xml
INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/
```
**3. Apache Zookeeper 3.9.3**
```
C:\Users\XXX\apache-zookeeper-3.9.3-bin>bin\zkServer.cmd
C:\Users\XXX\apache-zookeeper-3.9.3-bin>call "C:\Users\XXX\graalvm-jdk-17.0.14+8.1"\bin\java "-Dzookeeper.log.dir=C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\logs" "-Dzookeeper.log.file=zookeeper-XXX-server-DESKTOP-66E87L5.log" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:OnOutOfMemoryError=cmd /c taskkill /pid %%p /t /f" -cp "C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\build\classes;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\build\lib\*;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\*;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\*;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\conf" org.apache.zookeeper.server.quorum.QuorumPeerMain "C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\conf\zoo.cfg"
2025-03-01 15:15:37,456 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@177] - Reading configuration from: C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\conf\zoo.cfg
2025-03-01 15:15:37,458 [myid:] - WARN [main:o.a.z.s.u.VerifyingFileFactory@65] - data is relative. Prepend .\ to indicate that you're sure!
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@440] - clientPortAddress is 0.0.0.0:2181
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@444] - secureClientPort is not set
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@460] - observerMasterPort is not set
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@477] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.DatadirCleanupManager@101] - Purge task is not scheduled.
2025-03-01 15:15:37,460 [myid:] - WARN [main:o.a.z.s.q.QuorumPeerMain@139] - Either no config or no quorum defined in config, running in standalone mode
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.j.ManagedUtil@46] - Log4j 1.2 jmx support not found; jmx disabled.
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@177] - Reading configuration from: C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\conf\zoo.cfg
2025-03-01 15:15:37,460 [myid:] - WARN [main:o.a.z.s.u.VerifyingFileFactory@65] - data is relative. Prepend .\ to indicate that you're sure!
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@440] - clientPortAddress is 0.0.0.0:2181
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@444] - secureClientPort is not set
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@460] - observerMasterPort is not set
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.q.QuorumPeerConfig@477] - metricsProvider.className is org.apache.zookeeper.metrics.impl.DefaultMetricsProvider
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.ZooKeeperServerMain@123] - Starting server
2025-03-01 15:15:37,460 [myid:] - INFO [main:o.a.z.s.ServerMetrics@64] - ServerMetrics initialized with provider org.apache.zookeeper.metrics.impl.DefaultMetricsProvider@4c762604
2025-03-01 15:15:37,478 [myid:] - INFO [main:o.a.z.s.a.DigestAuthenticationProvider@51] - ACL digest algorithm is: SHA1
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.s.a.DigestAuthenticationProvider@65] - zookeeper.DigestAuthenticationProvider.enabled = true
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.s.p.FileTxnSnapLog@124] - zookeeper.snapshot.trust.empty : false
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] -
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - ______ _
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - |___ / | |
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - / / ___ ___ | | __ ___ ___ _ __ ___ _ __
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - / / / _ \ / _ \ | |/ / / _ \ / _ \ | '_ \ / _ \ | '__|
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - / /__ | (_) | | (_) | | < | __/ | __/ | |_) | | __/ | |
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - /_____| \___/ \___/ |_|\_\ \___| \___| | .__/ \___| |_|
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - | |
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] - |_|
2025-03-01 15:15:37,481 [myid:] - INFO [main:o.a.z.ZookeeperBanner@42] -
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:zookeeper.version=3.9.3-c26634f34490bb0ea7a09cc51e05ede3b4e320ee, built on 2024-10-17 23:21 UTC
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:host.name=DESKTOP-66E87L5
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.version=17.0.14
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.vendor=Oracle Corporation
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.home=C:\Users\XXX\graalvm-jdk-17.0.14+8.1
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.class.path=C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\build\classes;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\build\lib\*;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\*;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\audience-annotations-0.12.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\commons-cli-1.5.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\commons-io-2.17.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jackson-annotations-2.15.2.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jackson-core-2.15.2.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jackson-databind-2.15.2.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\javax.servlet-api-3.1.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-http-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-io-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-security-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-server-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-servlet-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-util-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jetty-util-ajax-9.4.56.v20240826.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\jline-2.14.6.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\logback-classic-1.2.13.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\logback-core-1.2.13.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\metrics-core-4.1.12.1.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-buffer-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-codec-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-common-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-handler-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-resolver-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final-linux-aarch_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final-linux-x86_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final-osx-aarch_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final-osx-x86_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final-windows-x86_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-boringssl-static-2.0.66.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-tcnative-classes-2.0.66.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-transport-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-transport-classes-epoll-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-transport-native-epoll-4.1.113.Final-linux-x86_64.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\netty-transport-native-unix-common-4.1.113.Final.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\simpleclient-0.9.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\simpleclient_common-0.9.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\simpleclient_hotspot-0.9.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\simpleclient_servlet-0.9.0.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\slf4j-api-1.7.30.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\snappy-java-1.1.10.5.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\zookeeper-3.9.3.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\zookeeper-jute-3.9.3.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\lib\zookeeper-prometheus-metrics-3.9.3.jar;C:\Users\XXX\apache-zookeeper-3.9.3-bin\bin\..\conf
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.library.path=C:\Users\XXX\graalvm-jdk-17.0.14+8.1\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PuTTY\;C:\Users\XXX\AppData\Local\Microsoft\WindowsApps;C:\Users\XXX\graalvm-jdk-17.0.14+8.1\bin;;C:\Users\XXX\graalvm-jdk-17.0.14+8.1\bin;.
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.io.tmpdir=C:\Users\XXX\AppData\Local\Temp\
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:java.compiler=<NA>
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.name=Windows 11
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.arch=amd64
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.version=10.0
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:user.name=XXX
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:user.home=C:\Users\XXX
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:user.dir=C:\Users\XXX\apache-zookeeper-3.9.3-bin
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.memory.free=495MB
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.memory.max=8136MB
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.Environment@98] - Server environment:os.memory.total=512MB
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@149] - zookeeper.enableEagerACLCheck = false
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@162] - zookeeper.digest.enabled = true
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@166] - zookeeper.closeSessionTxn.enabled = true
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@2242] - zookeeper.serializeLastProcessedZxid.enabled = true
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1585] - zookeeper.flushDelay = 0 ms
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1594] - zookeeper.maxWriteQueuePollTime = 0 ms
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1603] - zookeeper.maxBatchSize=1000
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@287] - zookeeper.intBufferStartingSizeBytes = 1024
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.BlueThrottle@141] - Weighed connection throttling is disabled
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.AuthenticationHelper@66] - zookeeper.enforce.auth.enabled = false
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.AuthenticationHelper@67] - zookeeper.enforce.auth.schemes = []
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1395] - minSessionTimeout set to 4000 ms
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1404] - maxSessionTimeout set to 40000 ms
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ResponseCache@45] - getData response cache size is initialized with value 400.
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ResponseCache@45] - getChildren response cache size is initialized with value 400.
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@109] - zookeeper.pathStats.slotCapacity = 60
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@110] - zookeeper.pathStats.slotDuration = 15
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@111] - zookeeper.pathStats.maxDepth = 6
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@112] - zookeeper.pathStats.initialDelay = 5
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@113] - zookeeper.pathStats.delay = 5
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.u.RequestPathMetricsCollector@114] - zookeeper.pathStats.enabled = false
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1622] - The max bytes for all large requests are set to 104857600
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@1636] - The large request threshold is set to -1
2025-03-01 15:15:37,492 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@385] - Created server with tickTime 2000 ms minSessionTimeout 4000 ms maxSessionTimeout 40000 ms clientPortListenBacklog -1 dataLogdir data\version-2 snapdir data\version-2
2025-03-01 15:15:37,513 [myid:] - INFO [main:o.e.j.u.l.Log@170] - Logging initialized @220ms to org.eclipse.jetty.util.log.Slf4jLog
2025-03-01 15:15:37,545 [myid:] - WARN [main:o.e.j.s.h.ContextHandler@1662] - o.e.j.s.ServletContextHandler@6cf0e0ba{/,null,STOPPED} contextPath ends with /*
2025-03-01 15:15:37,545 [myid:] - WARN [main:o.e.j.s.h.ContextHandler@1673] - Empty contextPath
2025-03-01 15:15:37,556 [myid:] - INFO [main:o.e.j.s.Server@375] - jetty-9.4.56.v20240826; built: 2024-08-26T17:15:05.868Z; git: ec6782ff5ead824dabdcf47fa98f90a4aedff401; jvm 17.0.14+8-LTS-jvmci-23.0-b54
2025-03-01 15:15:37,570 [myid:] - INFO [main:o.e.j.s.s.DefaultSessionIdManager@334] - DefaultSessionIdManager workerName=node0
2025-03-01 15:15:37,570 [myid:] - INFO [main:o.e.j.s.s.DefaultSessionIdManager@339] - No SessionScavenger set, using defaults
2025-03-01 15:15:37,570 [myid:] - INFO [main:o.e.j.s.s.HouseKeeper@132] - node0 Scavenging every 660000ms
2025-03-01 15:15:37,570 [myid:] - WARN [main:o.e.j.s.ConstraintSecurityHandler@759] - ServletContext@o.e.j.s.ServletContextHandler@6cf0e0ba{/,null,STARTING} has uncovered http methods for path: /*
2025-03-01 15:15:37,583 [myid:] - INFO [main:o.e.j.s.h.ContextHandler@921] - Started o.e.j.s.ServletContextHandler@6cf0e0ba{/,null,AVAILABLE}
2025-03-01 15:15:37,647 [myid:] - INFO [main:o.e.j.s.AbstractConnector@333] - Started ServerConnector@3c407114{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2025-03-01 15:15:37,647 [myid:] - INFO [main:o.e.j.s.Server@415] - Started @352ms
2025-03-01 15:15:37,647 [myid:] - INFO [main:o.a.z.s.a.JettyAdminServer@201] - Started AdminServer on address 0.0.0.0, port 8080 and command URL /commands
2025-03-01 15:15:37,649 [myid:] - INFO [main:o.a.z.s.ServerCnxnFactory@172] - Using org.apache.zookeeper.server.NIOServerCnxnFactory as server connection factory
2025-03-01 15:15:37,649 [myid:] - WARN [main:o.a.z.s.ServerCnxnFactory@337] - maxCnxns is not configured, using default value 0.
2025-03-01 15:15:37,649 [myid:] - INFO [main:o.a.z.s.NIOServerCnxnFactory@652] - Configuring NIO connection handler with 10s sessionless connection timeout, 3 selector thread(s), 56 worker threads, and 64 kB direct buffers.
2025-03-01 15:15:37,649 [myid:] - INFO [main:o.a.z.s.NIOServerCnxnFactory@660] - binding to port 0.0.0.0/0.0.0.0:2181
2025-03-01 15:15:37,659 [myid:] - INFO [main:o.a.z.s.w.WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
2025-03-01 15:15:37,660 [myid:] - INFO [main:o.a.z.s.w.WatchManagerFactory@42] - Using org.apache.zookeeper.server.watch.WatchManager as watch manager
2025-03-01 15:15:37,660 [myid:] - INFO [main:o.a.z.s.ZKDatabase@134] - zookeeper.snapshotSizeFactor = 0.33
2025-03-01 15:15:37,660 [myid:] - INFO [main:o.a.z.s.ZKDatabase@154] - zookeeper.commitLogCount=500
2025-03-01 15:15:37,664 [myid:] - INFO [main:o.a.z.s.p.SnapStream@61] - zookeeper.snapshot.compression.method = CHECKED
2025-03-01 15:15:37,664 [myid:] - INFO [main:o.a.z.s.p.FileTxnSnapLog@480] - Snapshotting: 0x0 to data\version-2\snapshot.0
2025-03-01 15:15:37,665 [myid:] - INFO [main:o.a.z.s.ZKDatabase@291] - Snapshot loaded in 5 ms, highest zxid is 0x0, digest is 1371985504
2025-03-01 15:15:37,666 [myid:] - INFO [main:o.a.z.s.p.FileTxnSnapLog@480] - Snapshotting: 0x0 to data\version-2\snapshot.0
2025-03-01 15:15:37,667 [myid:] - INFO [main:o.a.z.s.ZooKeeperServer@589] - Snapshot taken in 0 ms
2025-03-01 15:15:37,670 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::o.a.z.s.PrepRequestProcessor@138] - PrepRequestProcessor (sid:0) started, reconfigEnabled=false
2025-03-01 15:15:37,670 [myid:] - INFO [main:o.a.z.s.RequestThrottler@75] - zookeeper.request_throttler.shutdownTimeout = 10000 ms
2025-03-01 15:15:37,719 [myid:] - INFO [main:o.a.z.s.ContainerManager@83] - Using checkIntervalMs=60000 maxPerMinute=10000 maxNeverUsedIntervalMs=0
2025-03-01 15:15:37,720 [myid:] - INFO [main:o.a.z.a.ZKAuditProvider@42] - ZooKeeper audit is disabled.
2025-03-01 15:28:22,213 [myid:] - INFO [SyncThread:0:o.a.z.s.p.FileTxnLog@291] - Creating new log file: log.1
```
**4. H2 Database Version 2.3.232**
**3. H2 Database Version 2.3.232**
```
C:\Users\XXX\Desktop>SET JAVA_HOME=C:\Users\XXX\graalvm-jdk-17.0.14+8.1

@ -1,52 +0,0 @@
package com.example.sbcamel;
import java.io.Serializable;
import java.util.StringJoiner;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
/**
* User entity
*
*/
@SuppressWarnings("serial")
public class User implements Serializable {
@NotNull(message = "custom message")
private Integer id;
@NotNull
@Size(min = 3, max = 20)
private String name;
public User() {
}
public User(Integer id, String name) {
this.id = id;
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return new StringJoiner(", ", User.class.getSimpleName() + "[", "]").add("id=" + id).add("name='" + name + "'")
.toString();
}
}

@ -1,50 +0,0 @@
package com.example.sbcamel;
import java.util.Collection;
import jakarta.validation.Valid;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
/**
* Service interface for managing users.
*/
public interface UserService {
/**
* Find a user by the given ID
*
* @param id the ID of the user
* @return the user, or <code>null</code> if user not found.
*/
@GET
@Path("/user/{id}")
@Produces(MediaType.APPLICATION_JSON)
User findUser(@PathParam("id") Integer id);
/**
* Find all users
*
* @return a collection of all users
*/
@GET
@Path("/user")
@Produces(MediaType.APPLICATION_JSON)
Collection<User> findUsers();
/**
* Update the given user
*
* @param user the user
*/
@POST
@Path("/user")
@Consumes(MediaType.APPLICATION_JSON)
User updateUser(@Valid User user);
}

@ -0,0 +1,21 @@
package com.example.sbcamel.init;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.example.sbcamel.processor.LoginProcessor;
import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
@Configuration
public class AppConfig {
@Bean
public JacksonJsonProvider jaxrsProvider() {
return new JacksonJsonProvider();
}
@Bean
public LoginProcessor loginProcessor() {
return new LoginProcessor();
}
}

@ -1,11 +1,10 @@
package com.example.sbcamel;
package com.example.sbcamel.init;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.bean.BeanConstants;
import org.apache.camel.component.bean.validator.BeanValidationException;
import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.camel.component.zookeepermaster.policy.MasterRoutePolicy;
import org.apache.camel.model.dataformat.JsonLibrary;
import org.springframework.beans.factory.annotation.Autowired;
@ -13,30 +12,31 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.example.sbcamel.mapper.SessionMapper;
import com.example.sbcamel.processor.LoginProcessor;
import com.example.sbcamel.service.SessionService;
import jakarta.annotation.PostConstruct;
import jakarta.ws.rs.core.Response;
@Component
public class CamelRouter extends RouteBuilder {
private static final String createUserSql = "CREATE TABLE IF NOT EXISTS public.\"user\" (id BIGINT not null, "
+ "name CHARACTER VARYING not null, PRIMARY KEY (id))";
private static final String createSessionSql = "CREATE TABLE IF NOT EXISTS public.session (sessionId UUID not null, "
+ "username CHARACTER VARYING not null, password CHARACTER VARYING not null, PRIMARY KEY (sessionId))";
@Value("${app.queue-name}")
private String queueName;
@Value("${app.zookeeper.url}")
private String zookeeperUrl;
@Value("${app.zookeeper.group-name}")
private String groupName;
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
protected LoginProcessor loginProcessor;
@PostConstruct
private void init() {
org.apache.ibatis.logging.LogFactory.useSlf4jLogging();
jdbcTemplate.execute(createUserSql);
jdbcTemplate.execute(createSessionSql);
}
@Override
@ -50,7 +50,7 @@ public class CamelRouter extends RouteBuilder {
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(Response.Status.NOT_FOUND.getStatusCode()))
.setBody(simple("${exchangeProperty.CamelExceptionCaught.getMessage()}"));
from("cxfrs:/api?resourceClasses=" + UserService.class.getName() + "&bindingStyle=Default"
from("cxfrs:/api?resourceClasses=" + SessionService.class.getName() + "&bindingStyle=Default"
+ "&providers=jaxrsProvider&loggingFeatureEnabled=true").to("log:cxfrs?showAll=true")
.to("bean-validator:user").to("activemq6:queue:" + queueName).process(exchange -> {
if (exchange.getMessage().getBody() != null && exchange.getMessage().getBody() instanceof byte[]
@ -61,21 +61,19 @@ public class CamelRouter extends RouteBuilder {
}
});
MasterRoutePolicy masterRoutePolicy = new MasterRoutePolicy();
masterRoutePolicy.setZooKeeperUrl(zookeeperUrl);
masterRoutePolicy.setGroupName(groupName);
from("activemq6:queue:" + queueName).autoStartup("false").routePolicy(masterRoutePolicy)
from("activemq6:queue:" + queueName)
.process(exchange -> exchange.getIn().setHeader(BeanConstants.BEAN_METHOD_NAME,
exchange.getIn().getHeader(CxfConstants.OPERATION_NAME.toLowerCase())))
.to("log:activemq?showAll=true").transacted("propagationRequired").choice()
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("updateUser"))
.to("mybatis:com.example.sbcamel.mapper.UserMapper.updateUser?statementType=Update")
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findUsers"))
.to("mybatis:com.example.sbcamel.mapper.UserMapper.findUsers?statementType=SelectList")
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findUser"))
.to("mybatis:com.example.sbcamel.mapper.UserMapper.findUser?statementType=SelectOne")
.end().marshal().json(JsonLibrary.Jackson);
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("updateSession"))
.to("mybatis:" + SessionMapper.class.getName() + ".updateSession?statementType=Update")
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findSessions"))
.to("mybatis:" + SessionMapper.class.getName() + ".findSessions?statementType=SelectList")
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("findSession"))
.to("mybatis:" + SessionMapper.class.getName() + ".findSession?statementType=SelectOne")
.when(header(BeanConstants.BEAN_METHOD_NAME).isEqualTo("login"))
.to("mybatis:" + SessionMapper.class.getName() + ".findSession?statementType=SelectOne")
.process(loginProcessor).end().marshal().json(JsonLibrary.Jackson);
}
}

@ -1,4 +1,4 @@
package com.example.sbcamel;
package com.example.sbcamel.init;
import java.io.IOException;
import java.util.Objects;

@ -1,4 +1,4 @@
package com.example.sbcamel;
package com.example.sbcamel.init;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
@ -13,8 +13,6 @@ import org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopul
import org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator;
import org.springframework.security.web.SecurityFilterChain;
import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider;
@Configuration
public class SecurityConfig {
@ -57,10 +55,5 @@ public class SecurityConfig {
factory.setUserSearchFilter(userSearchFilter);
factory.setLdapAuthoritiesPopulator(authorities);
return factory.createAuthenticationManager();
}
@Bean
public JacksonJsonProvider jaxrsProvider() {
return new JacksonJsonProvider();
}
}
}

@ -0,0 +1,34 @@
package com.example.sbcamel.mapper;
import java.util.Collection;
import java.util.UUID;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import com.example.sbcamel.service.Session;
import com.example.sbcamel.service.UuidTypeHandler;
public interface SessionMapper {
@Insert({ "<script>",
"MERGE INTO public.session (sessionId, username, password) KEY (sessionId) VALUES (#{sessionId, javaType=java.util.UUID, "
+ "jdbcType=OTHER, typeHandler=com.example.sbcamel.service.UuidTypeHandler}, #{username}, #{password}) ",
"</script>" })
Session updateSession(Session session);
@Results({ @Result(property = "sessionId", column = "sessionId", javaType=UUID.class, jdbcType=JdbcType.OTHER, typeHandler=UuidTypeHandler.class),
@Result(property = "username", column = "username"), @Result(property = "password", column = "password") })
@Select({ "<script>", "select sessionId, username, password from public.session where sessionId=#{list[0], javaType=java.util.UUID, "
+ "jdbcType=OTHER, typeHandler=com.example.sbcamel.service.UuidTypeHandler}",
"</script>" })
Session findSession(UUID sessionId);
@Results({ @Result(property = "sessionId", column = "sessionId", javaType=UUID.class, jdbcType=JdbcType.OTHER, typeHandler=UuidTypeHandler.class),
@Result(property = "username", column = "username"), @Result(property = "password", column = "password") })
@Select({ "<script>", "select sessionId, username, password from public.session order by sessionId", "</script>" })
Collection<Session> findSessions();
}

@ -1,24 +0,0 @@
package com.example.sbcamel.mapper;
import java.util.Collection;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import com.example.sbcamel.User;
public interface UserMapper {
@Insert({ "<script>", "MERGE INTO public.\"user\" (id, name) KEY (id) VALUES (#{id}, #{name}) ", "</script>" })
User updateUser(User user);
@Results({ @Result(property = "id", column = "id"), @Result(property = "name", column = "name") })
@Select({ "<script>", "select id, name from public.\"user\" where id=#{list[0]}", "</script>" })
User findUser(Integer id);
@Results({ @Result(property = "id", column = "id"), @Result(property = "name", column = "name") })
@Select({ "<script>", "select id, name from public.\"user\" order by id", "</script>" })
Collection<User> findUsers();
}

@ -0,0 +1,17 @@
package com.example.sbcamel.processor;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoginProcessor implements Processor {
private static final Logger logger = LoggerFactory.getLogger(LoginProcessor.class);
@Override
public void process(Exchange exchange) throws Exception {
logger.info("response body: {}", exchange.getMessage().getBody());
}
}

@ -0,0 +1,66 @@
package com.example.sbcamel.service;
import java.io.Serializable;
import java.util.UUID;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
/**
* User entity
*
*/
@SuppressWarnings("serial")
public class Session implements Serializable {
private UUID sessionId;
@NotNull
@Size(min = 3, max = 40)
private String username;
@NotNull
@Size(min = 3, max = 40)
private String password;
public Session() {
}
public Session(UUID sessionId, @NotNull @Size(min = 3, max = 40) String username,
@NotNull @Size(min = 3, max = 40) String password) {
this.sessionId = sessionId;
this.username = username;
this.password = password;
}
public UUID getSessionId() {
return sessionId;
}
public void setSessionId(UUID sessionId) {
this.sessionId = sessionId;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
}

@ -0,0 +1,39 @@
package com.example.sbcamel.service;
import java.util.Collection;
import java.util.UUID;
import jakarta.validation.Valid;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
/**
* Service interface for managing sessions.
*/
public interface SessionService {
@POST
@Path("/session")
@Consumes(MediaType.APPLICATION_JSON)
Session updateSession(@Valid Session session);
@GET
@Path("/session/{sessionId}")
@Produces(MediaType.APPLICATION_JSON)
Session findSession(@PathParam("sessionId") UUID sessionId);
@GET
@Path("/session")
@Produces(MediaType.APPLICATION_JSON)
Collection<Session> findSessions();
@POST
@Path("/login/{sessionId}")
@Produces(MediaType.APPLICATION_JSON)
Session login(@PathParam("sessionId") UUID sessionId);
}

@ -0,0 +1,33 @@
package com.example.sbcamel.service;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.UUID;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
public class UuidTypeHandler extends BaseTypeHandler<UUID> {
@Override
public void setNonNullParameter(PreparedStatement ps, int i, UUID parameter, JdbcType jdbcType)
throws SQLException {
ps.setObject(i, parameter);
}
@Override
public UUID getNullableResult(ResultSet rs, String columnName) throws SQLException {
return rs.getObject(columnName, UUID.class);
}
@Override
public UUID getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
return rs.getObject(columnIndex, UUID.class);
}
@Override
public UUID getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
return cs.getObject(columnIndex, UUID.class);
}
}
Loading…
Cancel
Save