Skip to content

Generate test app when RabbitMQ Streams is selected#1611

Open
eddumelendez wants to merge 2 commits intospring-io:mainfrom
eddumelendez:gen-testapp-amqp-streams
Open

Generate test app when RabbitMQ Streams is selected#1611
eddumelendez wants to merge 2 commits intospring-io:mainfrom
eddumelendez:gen-testapp-amqp-streams

Conversation

@eddumelendez
Copy link
Contributor

Currently, when rabbitmq streams and docker compose/testcontainers are selected, no container is provided. For that reason, the test and test app can not be executed sucessfully. RabbitMQ Streams requires an additional configuration to enable it using Spring Boot and also in the container itself but providing RabbitMQ service would be enough to execute the test and test app.

The configuration to enable rabbitmq streams can be found here

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 8, 2024
@mhalbritter
Copy link
Contributor

I'd like to wait until spring-projects/spring-boot#42443 is resolved before proceeding here.

}

private boolean isAmqpEnabled(Build build) {
return build.dependencies().has("amqp") || build.dependencies().has("amqp-streams");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the value to a constant file enhances the maintainability of the code. It centralizes the value, making it easier to update and manage. If the value needs to be changed, it can be done in one place without searching through the entire codebase

@mhalbritter
Copy link
Contributor

To properly get RabbitMQ streams working, we'd need to be able to generate a docker-compose.yaml file which looks like this:

services:
  rabbitmq:
    image: 'rabbitmq:latest'
    environment:
      - 'RABBITMQ_DEFAULT_PASS=secret'
      - 'RABBITMQ_DEFAULT_USER=myuser'
    configs:
      - source: plugins
        target: /etc/rabbitmq/enabled_plugins
    ports:
      - '5672'
      - '5552'

configs:
  plugins:
    content: "[rabbitmq_stream]."

and for Testcontainers:

@Bean
@ServiceConnection(type = RabbitStreamConnectionDetails.class)
RabbitMQContainer rabbitContainer() {
return new RabbitMQContainer(DockerImageName.parse("rabbitmq:latest"))
		.withExposedPorts(5552)
		.withCopyToContainer(Transferable.of("[rabbitmq_stream]."), "/etc/rabbitmq/enabled_plugins");
}

mhalbritter pushed a commit to eddumelendez/start.spring.io that referenced this pull request Feb 23, 2026
@mhalbritter mhalbritter force-pushed the gen-testapp-amqp-streams branch from c45a19a to 6e5cfd8 Compare February 23, 2026 11:18
@mhalbritter mhalbritter force-pushed the gen-testapp-amqp-streams branch from 6e5cfd8 to a3700d3 Compare February 23, 2026 11:19
@mhalbritter
Copy link
Contributor

I rebased this branch on top of main.

@mhalbritter
Copy link
Contributor

I've created spring-io/initializr#1758 and #2089 and #2090.

Signed-off-by: Eddú Meléndez <eddu.melendez@gmail.com>
@eddumelendez eddumelendez force-pushed the gen-testapp-amqp-streams branch from 0ac42ac to 270f569 Compare February 27, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants