Skip to content

Commit 9cf9222

Browse files
committed
Set default Docker image for AMQP Dev Services
1 parent 3594dcf commit 9cf9222

File tree

9 files changed

+20
-12
lines changed

9 files changed

+20
-12
lines changed

build-parent/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@
110110
<!-- Artemis test dependencies -->
111111
<artemis.version>2.44.0</artemis.version>
112112

113+
<!-- Dev Services Images -->
114+
<!-- TODO switch to apache/activemq-artemis to match the artemis version-->
115+
<amqp.image>quay.io/artemiscloud/activemq-artemis-broker:1.0.25</amqp.image>
116+
113117
<!-- Code Coverage Properties-->
114118
<jacoco.agent.argLine></jacoco.agent.argLine>
115119

docs/src/main/asciidoc/_attributes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
:logstash-image: ${logstash.image}
2020
:kibana-image: ${kibana.image}
2121
:keycloak-image: ${keycloak.docker.image}
22+
:amqp-image: ${amqp.image}
2223
:jandex-version: ${jandex.version}
2324
:jandex-gradle-plugin-version: ${jandex-gradle-plugin.version}
2425
:kotlin-version: ${kotlin.version}

docs/src/main/asciidoc/amqp-dev-services.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ You can set the port by configuring the `quarkus.amqp.devservices.port` property
5050
Dev Services for AMQP uses https://quay.io/repository/artemiscloud/activemq-artemis-broker[activemq-artemis-broker] images.
5151
You can configure the image and version using the `quarkus.amqp.devservices.image-name` property:
5252

53-
[source, properties]
53+
[source, properties, subs=attributes+]
5454
----
55-
quarkus.amqp.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:latest
55+
quarkus.amqp.devservices.image-name={amqp-image}
5656
----
5757

5858
IMPORTANT: The configured image must be _compatible_ with the `activemq-artemis-broker` one.
@@ -65,12 +65,12 @@ The ports 5672 and 8161 (web console) are exposed.
6565
Dev Services for AMQP supports xref:compose-dev-services.adoc[Compose Dev Services].
6666
It relies on a `compose-devservices.yml`, such as:
6767

68-
[source,yaml]
68+
[source,yaml,subs=attributes+]
6969
----
7070
name: <application name>
7171
services:
7272
artemis:
73-
image: quay.io/artemiscloud/activemq-artemis-broker:1.0.28
73+
image: {amqp-image}
7474
ports:
7575
- "5672"
7676
- "8161"

docs/src/main/asciidoc/amqp.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,14 @@ Open `http://localhost:8080/quotes.html` in your browser and request some quotes
366366
When not running in dev or test mode, you will need to start your AMQP broker.
367367
You can follow the instructions from the https://activemq.apache.org/components/artemis/documentation/latest/using-server.html[Apache ActiveMQ Artemis website] or create a `docker-compose.yaml` file with the following content:
368368

369-
[source, yaml]
369+
[source, yaml ,subs=attributes+]
370370
----
371371
version: '2'
372372
373373
services:
374374
375375
artemis:
376-
image: quay.io/artemiscloud/activemq-artemis-broker:1.0.25
376+
image: {amqp-image}
377377
ports:
378378
- "8161:8161"
379379
- "61616:61616"

docs/src/main/asciidoc/jms.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ implementation("org.amqphub.quarkus:quarkus-qpid-jms")
8181
Then, we need an AMQP broker. In this case we will use an Apache ActiveMQ Artemis server.
8282
You can follow the instructions from the https://activemq.apache.org/components/artemis/[Apache Artemis website] or start a broker via docker using the https://artemiscloud.io/[ArtemisCloud] container image:
8383

84-
[source,bash]
84+
[source,bash,subs=attributes+]
8585
----
86-
docker run -it --rm -p 8161:8161 -p 61616:61616 -p 5672:5672 -e AMQ_USER=quarkus -e AMQ_PASSWORD=quarkus quay.io/artemiscloud/activemq-artemis-broker:1.0.25
86+
docker run -it --rm -p 8161:8161 -p 61616:61616 -p 5672:5672 -e AMQ_USER=quarkus -e AMQ_PASSWORD=quarkus {amqp-image}
8787
----
8888

8989
=== The price producer

extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesBuildTimeConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Map;
44
import java.util.Optional;
55

6+
import io.quarkus.runtime.annotations.ConfigDocDefault;
67
import io.quarkus.runtime.annotations.ConfigDocMapKey;
78
import io.quarkus.runtime.annotations.ConfigGroup;
89
import io.smallrye.config.WithDefault;
@@ -34,8 +35,8 @@ public interface AmqpDevServicesBuildTimeConfig {
3435
* page</a>
3536
* to find the available versions.
3637
*/
37-
@WithDefault("quay.io/artemiscloud/activemq-artemis-broker:1.0.25")
38-
String imageName();
38+
@ConfigDocDefault(value = "`{amqp-image}`", escape = false)
39+
Optional<String> imageName();
3940

4041
/**
4142
* The value of the {@code AMQ_EXTRA_ARGS} environment variable to pass to the container.

extensions/smallrye-reactive-messaging-amqp/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/amqp/deployment/AmqpDevServicesProcessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.quarkus.smallrye.reactivemessaging.amqp.deployment;
22

3+
import static io.quarkus.devservices.common.ConfigureUtil.getDefaultImageNameFor;
34
import static io.quarkus.devservices.common.ContainerLocator.locateContainerWithLabels;
45
import static io.quarkus.devservices.common.Labels.QUARKUS_DEV_SERVICE;
56

@@ -291,7 +292,7 @@ private static final class AmqpDevServiceCfg {
291292

292293
public AmqpDevServiceCfg(AmqpDevServicesBuildTimeConfig devServicesConfig) {
293294
this.devServicesEnabled = devServicesConfig.enabled().orElse(true);
294-
this.imageName = devServicesConfig.imageName();
295+
this.imageName = devServicesConfig.imageName().orElseGet(() -> getDefaultImageNameFor("amqp"));
295296
this.fixedExposedPort = devServicesConfig.port().orElse(0);
296297
this.extra = devServicesConfig.extraArgs();
297298
this.shared = devServicesConfig.shared();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default.image=${amqp.image}

integration-tests/virtual-threads/jms-virtual-threads/src/main/resources/application.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ mp.messaging.outgoing.prices-out.destination=prices
55
smallrye.messaging.worker.<virtual-thread>.max-concurrency=5
66

77
quarkus.artemis.devservices.enabled=true
8-
quarkus.artemis.devservices.image-name=quay.io/artemiscloud/activemq-artemis-broker:1.0.25
8+
quarkus.artemis.devservices.image-name=${amqp.image}

0 commit comments

Comments
 (0)