spring-projects / spring-projects/spring-boot

Make it easier to consume multiple connection details beans of the same type with Docker Compose

Open
#42,746 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: pending-design-work type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

If you define multiple services of the same type in your Docker Compose yaml, you'll get multiple connection details beans of the same type in the context. Those beans are hard to inject as you can't just rely on the type. Matching by name is possible, but we don't document how the names are generated.

Some things that we could do:

  1. Document how the bean names are generated
  2. Support a label that allows the bean name to be specified
  3. Support a label that allows a connection details bean to be marked as @Primary, with @Qualifier, @Fallback, etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files or tests. Start by tracing how Docker Compose connection details beans are named and injected, then compare the three proposed approaches; done means a documented or implemented way to consume multiple same-type beans, with coverage for the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, java, spring-boot
Domain
backend, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.