Skip to content

Commit 1e1489a

Browse files
committed
Migrate javax to jakarta and use new connector jakartams
1 parent 5e6c410 commit 1e1489a

File tree

9 files changed

+43
-328
lines changed

9 files changed

+43
-328
lines changed

build.sbt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ val pekkoConnectorVersion = "1.2.0"
1212
val pekkoConnectorKafkaVersion = "1.1.0"
1313

1414
val kafkaVersion = "3.9.0"
15-
val activemqVersion = "5.18.5" // We are stuck with 5.x
16-
val artemisVersion = "2.39.0"
15+
val artemisVersion = "2.44.0"
1716
val testContainersVersion = "1.21.3"
1817
val keycloakVersion = "26.3.2"
1918
val keycloakClientVersion = "26.0.6"
2019
val sttpVersion = "3.11.0"
2120
val influxdbVersion = "7.1.0"
2221
val awsClientVersion = "2.25.32"
23-
val gatlingVersion = "3.13.5"
22+
val gatlingVersion = "3.14.9"
2423
val circeVersion = "0.14.14"
2524

2625
val langchain4jVersion = "1.8.0"
@@ -47,13 +46,12 @@ libraryDependencies ++= Seq(
4746
"com.softwaremill.sttp.client3" %% "core" % sttpVersion,
4847
"com.softwaremill.sttp.client3" %% "pekko-http-backend" % sttpVersion,
4948

50-
"org.apache.activemq" % "activemq-client" % activemqVersion,
51-
"org.apache.activemq" % "activemq-broker" % activemqVersion,
52-
"org.apache.activemq" % "activemq-kahadb-store" % activemqVersion,
53-
"org.apache.pekko" %% "pekko-connectors-jms" % pekkoConnectorVersion,
54-
"javax.jms" % "jms" % "1.1",
49+
"org.apache.pekko" %% "pekko-connectors-jakartams" % pekkoConnectorVersion,
50+
"jakarta.jms" % "jakarta.jms-api" % "3.1.0",
5551
"jakarta.xml.bind" % "jakarta.xml.bind-api" % "4.0.2",
56-
"org.apache.activemq" % "artemis-jms-server" % artemisVersion,
52+
"jakarta.annotation" % "jakarta.annotation-api" % "3.0.0",
53+
"org.apache.activemq" % "artemis-jakarta-server" % artemisVersion,
54+
"org.apache.activemq" % "artemis-jakarta-client" % artemisVersion,
5755
"org.apache.activemq" % "artemis-protocols" % artemisVersion pomOnly(),
5856
"org.apache.activemq" % "artemis-openwire-protocol" % artemisVersion,
5957

@@ -79,15 +77,13 @@ libraryDependencies ++= Seq(
7977
"org.apache.pekko" %% "pekko-connectors-s3" % pekkoConnectorVersion,
8078
"org.apache.pekko" %% "pekko-connectors-dynamodb" % pekkoConnectorVersion,
8179

82-
8380
"org.apache.pekko" %% "pekko-connectors-kinesis" % pekkoConnectorVersion,
8481
"software.amazon.awssdk" % "kinesis" % awsClientVersion,
8582
"software.amazon.awssdk" % "apache-client" % awsClientVersion,
8683

8784
"org.apache.pekko" %% "pekko-connectors-sqs" % pekkoConnectorVersion,
8885
"software.amazon.awssdk" % "sqs" % awsClientVersion,
8986

90-
9187
"com.influxdb" %% "influxdb-client-scala" % influxdbVersion,
9288
"com.influxdb" % "flux-dsl" % influxdbVersion,
9389
"org.influxdb" % "influxdb-java" % "2.24",
@@ -99,7 +95,6 @@ libraryDependencies ++= Seq(
9995
"ca.uhn.hapi" % "hapi-structures-v281" % "2.3",
10096

10197
"org.apache.opennlp" % "opennlp-tools" % "2.5.5",
102-
10398
"org.apache.httpcomponents.client5" % "httpclient5" % "5.5",
10499
"org.apache.httpcomponents.core5" % "httpcore5" % "5.3.5",
105100
"commons-io" % "commons-io" % "2.20.0",
@@ -113,6 +108,7 @@ libraryDependencies ++= Seq(
113108

114109
"com.github.blemale" %% "scaffeine" % "5.3.0",
115110
"ch.qos.logback" % "logback-classic" % "1.5.18",
111+
"com.crobox.clickhouse" %% "client" % "1.2.6",
116112

117113
"org.testcontainers" % "testcontainers" % testContainersVersion,
118114
"org.testcontainers" % "elasticsearch" % testContainersVersion,
@@ -124,9 +120,6 @@ libraryDependencies ++= Seq(
124120
"org.testcontainers" % "localstack" % testContainersVersion,
125121
"org.testcontainers" % "clickhouse" % testContainersVersion,
126122

127-
"com.clickhouse" % "clickhouse-jdbc" % "0.7.2",
128-
"com.crobox.clickhouse" %% "client" % "1.2.6",
129-
130123
"org.opensearch" % "opensearch-testcontainers" % "2.1.2",
131124
"com.github.dasniko" % "testcontainers-keycloak" % "3.8.0",
132125
"eu.rekawek.toxiproxy" % "toxiproxy-java" % "2.1.7",
@@ -136,7 +129,6 @@ libraryDependencies ++= Seq(
136129

137130
"org.keycloak" % "keycloak-core" % keycloakVersion,
138131
"org.keycloak" % "keycloak-admin-client" % keycloakClientVersion,
139-
"org.jboss.spec.javax.ws.rs" % "jboss-jaxrs-api_2.1_spec" % "2.0.2.Final",
140132

141133
"org.postgresql" % "postgresql" % "42.7.7",
142134
"io.zonky.test.postgres" % "embedded-postgres-binaries-bom" % "17.5.0" % Test pomOnly(),
@@ -151,16 +143,15 @@ libraryDependencies ++= Seq(
151143
"dev.langchain4j" % "langchain4j-anthropic" % langchain4jVersion,
152144
"dev.langchain4j" % "langchain4j-ollama" % langchain4jVersion,
153145

154-
155146
// LangChain4j PgVector extension
156147
"dev.langchain4j" % "langchain4j-pgvector" % "1.8.0-beta15",
157148

158149
// LangChain4j embedding models
159150
"dev.langchain4j" % "langchain4j-embeddings-bge-small-en-v15-q" % "1.8.0-beta15",
160151
"dev.langchain4j" % "langchain4j-embeddings-all-minilm-l6-v2-q" % "1.8.0-beta15",
161152

162-
// Beautiful CLI output formatting
163-
"xyz.matthieucourt" %% "layoutz" % "0.3.0",
153+
// CLI output formatting
154+
"xyz.matthieucourt" %% "layoutz" % "0.5.0",
164155

165156
// https://docs.gatling.io/reference/integrations/build-tools/sbt-plugin
166157
"io.gatling" % "gatling-core" % gatlingVersion,

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.3")
44
//addDependencyTreePlugin
55

66
// https://docs.gatling.io/reference/integrations/build-tools/sbt-plugin
7-
addSbtPlugin("io.gatling" % "gatling-sbt" % "4.13.1")
7+
addSbtPlugin("io.gatling" % "gatling-sbt" % "4.17.8")

src/main/resources/broker.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Apache Artemis minimal broker config
1010
<journal-type>NIO</journal-type>
1111
<journal-pool-files>10</journal-pool-files>
1212

13+
<max-disk-usage>95</max-disk-usage>
14+
1315
<acceptors>
1416
<!-- https://activemq.apache.org/uri-protocols -->
1517
<acceptor name="in-vm">vm://0</acceptor>
@@ -30,7 +32,6 @@ Apache Artemis minimal broker config
3032
</security-setting>
3133
</security-settings>
3234

33-
<!-- TODO sync with broker_docker.xml -->
3435
<addresses>
3536
<address name="jms.queue.exampleQueue">
3637
<multicast>
@@ -47,6 +48,7 @@ Apache Artemis minimal broker config
4748
<dead-letter-address>jms.queue.deadLetterQueue</dead-letter-address>
4849
<max-delivery-attempts>3</max-delivery-attempts>
4950
<redelivery-delay>5000</redelivery-delay>
51+
<expiry-delay>60000</expiry-delay> <!-- 1 minute in ms -->
5052
<expiry-address>jms.queue.expiryQueue</expiry-address>
5153
<last-value-queue>true</last-value-queue>
5254
<max-size-bytes>100000</max-size-bytes>

src/main/scala/alpakka/env/JMSServerArtemis.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package alpakka.env
22

3+
import jakarta.jms.{ConnectionFactory, Queue, Session, TextMessage}
34
import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration
45
import org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ
56
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
@@ -9,7 +10,6 @@ import org.slf4j.{Logger, LoggerFactory}
910

1011
import java.time.LocalDateTime
1112
import java.util.Properties
12-
import javax.jms.{ConnectionFactory, Queue, Session, TextMessage}
1313
import javax.naming.{Context, InitialContext}
1414

1515
/**
@@ -18,7 +18,7 @@ import javax.naming.{Context, InitialContext}
1818
* Config: resources/broker.xml
1919
*
2020
* Doc:
21-
* https://activemq.apache.org/components/artemis/documentation/1.1.0/embedding-activemq.html
21+
* https://activemq.apache.org/components/artemis/documentation/latest
2222
* https://github.com/apache/activemq-artemis/blob/main/examples/features/standard/embedded-simple/src/main/java/org/apache/activemq/artemis/jms/example/EmbeddedExample.java
2323
* https://github.com/apache/activemq-artemis/tree/master/examples/features/standard/embedded-simple
2424
*
@@ -27,19 +27,19 @@ object JMSServerArtemis extends App {
2727
val logger: Logger = LoggerFactory.getLogger(this.getClass)
2828
val host: String = "127.0.0.1"
2929
val port = 21616
30-
val serverUrl = s"tcp://$host:$port"
30+
private val serverUrl = s"tcp://$host:$port"
3131

3232
// Does not run with Java 23, this suggested workaround does not help
3333
// Doc: https://issues.apache.org/jira/browse/ARTEMIS-4975
3434
System.setProperty("java.security.manager", "allow")
3535

36-
val securityConfig = new SecurityConfiguration()
36+
private val securityConfig = new SecurityConfiguration()
3737
securityConfig.addUser("artemis", "artemis")
3838
securityConfig.addRole("artemis", "guest")
3939
// Needed when run with broker_docker.xml
4040
securityConfig.addRole("artemis", "amq")
4141
securityConfig.setDefaultUser("artemis")
42-
val securityManager = new ActiveMQJAASSecurityManager(classOf[InVMLoginModule].getName, securityConfig)
42+
private val securityManager = new ActiveMQJAASSecurityManager(classOf[InVMLoginModule].getName, securityConfig)
4343

4444
val broker = new EmbeddedActiveMQ()
4545
broker.setConfigResourcePath("broker.xml")

src/main/scala/alpakka/env/jms/AESBroker.java

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)