apache / apache/rocketmq-spring

`RocketMQProperties#nameServer` should offer a more user-friendly format

Open
#8 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
2.3k
Forks
943
PR merge metrics
No merged PRs in 30d

Description

The `nameServer` property ultimately maps to `ClientConfig#setNamesrvAddr` that requires a `host:port` pair separated by `;`

I think it would be nicer to not expose that complexity back to the configuration. Rather, the configuration should expose a `List` where each item represent a `host:port` pair.

There are several advantages to this:

* Each pair can be checked individually and an exception can be thrown if its format is invalid
* YAML configuration is much more readable as you can use the native list format
* Perhaps the property can be renamed to `servers` to express it is a list

Taking this into consideration (+ #9) the property can be configured as follows:

```yml
rocketmq:
servers:
- 10.0.0.1:9876
- 10.0.0.2:9876
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with RocketMQProperties#nameServer and trace how it maps to ClientConfig#setNamesrvAddr. Check how YAML configuration is bound and where validation belongs; done means accepting a list of host:port values, validating each item, and producing the proposed servers configuration without exposing the semicolon-separated format.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.