Skip to content

Commit f0e074e

Browse files
committed
Set default Docker image for RabbitMQ Dev Services
1 parent 969f256 commit f0e074e

File tree

7 files changed

+12
-7
lines changed

7 files changed

+12
-7
lines changed

build-parent/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
<amqp.image>quay.io/artemiscloud/activemq-artemis-broker:1.0.25</amqp.image>
116116
<apicurio-registry.image>quay.io/apicurio/apicurio-registry-mem:2.6.13.Final</apicurio-registry.image>
117117
<narayana-lra.image>quay.io/jbosstm/lra-coordinator:latest</narayana-lra.image>
118+
<rabbitmq.image>rabbitmq:3.12-management</rabbitmq.image>
118119

119120
<!-- Code Coverage Properties-->
120121
<jacoco.agent.argLine></jacoco.agent.argLine>

docs/src/main/asciidoc/_attributes.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
:apicurio-registry-image: ${apicurio-registry.image}
2424
:narayana-lra-image: ${narayana-lra.image}
2525
:mongo-image: ${mongo.image}
26+
:rabbitmq-image: ${rabbitmq.image}
2627
:jandex-version: ${jandex.version}
2728
:jandex-gradle-plugin-version: ${jandex-gradle-plugin.version}
2829
:kotlin-version: ${kotlin.version}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ You can set the port by configuring the `quarkus.rabbitmq.devservices.port` prop
5050
Dev Services for RabbitMQ uses official images available at https://hub.docker.com/_/rabbitmq.
5151
You can configure the image and version with the `quarkus.rabbitmq.devservices.image-name` property:
5252

53-
[source, properties]
53+
[source, properties, subs=attributes+]
5454
----
55-
quarkus.rabbitmq.devservices.image-name=rabbitmq:latest
55+
quarkus.rabbitmq.devservices.image-name={rabbitmq-image}
5656
----
5757

5858
== Access the management UI

docs/src/main/asciidoc/rabbitmq.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,14 @@ Open `http://localhost:8080/quotes.html` in your browser and request some quotes
419419
When not running in dev or test mode, you will need to start your RabbitMQ broker.
420420
You can follow the instructions from the https://hub.docker.com/_/rabbitmq[RabbitMQ Docker website] or create a `docker-compose.yaml` file with the following content:
421421

422-
[source, yaml]
422+
[source, yaml, subs=attributes+]
423423
----
424424
version: '2'
425425
426426
services:
427427
428428
rabbit:
429-
image: rabbitmq:3.12-management
429+
image: {rabbitmq-image}
430430
ports:
431431
- "5672:5672"
432432
networks:

extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesBuildTimeConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.Optional;
66
import java.util.OptionalInt;
77

8+
import io.quarkus.runtime.annotations.ConfigDocDefault;
89
import io.quarkus.runtime.annotations.ConfigDocMapKey;
910
import io.quarkus.runtime.annotations.ConfigGroup;
1011
import io.smallrye.config.WithDefault;
@@ -140,8 +141,8 @@ public interface Binding {
140141
* Note that only official RabbitMQ images are supported.
141142
* Specifically, the image repository must end with {@code rabbitmq}.
142143
*/
143-
@WithDefault("rabbitmq:3.12-management")
144-
String imageName();
144+
@ConfigDocDefault(value = "`{rabbitmq-image}`", escape = false)
145+
Optional<String> imageName();
145146

146147
/**
147148
* Indicates if the RabbitMQ broker managed by Quarkus Dev Services is shared.

extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/deployment/RabbitMQDevServicesProcessor.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.rabbitmq.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

@@ -371,7 +372,7 @@ static class Binding {
371372

372373
public RabbitMQDevServiceCfg(RabbitMQDevServicesBuildTimeConfig devServicesConfig) {
373374
this.devServicesEnabled = devServicesConfig.enabled().orElse(true);
374-
this.imageName = devServicesConfig.imageName();
375+
this.imageName = devServicesConfig.imageName().orElseGet(() -> getDefaultImageNameFor("rabbitmq"));
375376
this.fixedExposedPort = devServicesConfig.port().orElse(0);
376377
this.fixedExposedHttpPort = devServicesConfig.httpPort().orElse(0);
377378
this.shared = devServicesConfig.shared();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default.image=${rabbitmq.image}

0 commit comments

Comments
 (0)