You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "ban-xiu (via GitHub)" <gi...@apache.org> on 2026/03/10 13:09:31 UTC

[PR] Add registry port config [incubator-seata]

ban-xiu opened a new pull request, #8017:
URL: https://github.com/apache/incubator-seata/pull/8017

   <!--
       Licensed to the Apache Software Foundation (ASF) under one or more
       contributor license agreements.  See the NOTICE file distributed with
       this work for additional information regarding copyright ownership.
       The ASF licenses this file to You under the Apache License, Version 2.0
       (the "License"); you may not use this file except in compliance with
       the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
       
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
   -->
   <!-- Please make sure you have read and understood the contributing guidelines -->
   
   - [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines.
   - [x] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ## Problem Background
   
   In Docker deployment scenarios using port mapping (e.g., `-p 21908:8091`), the Seata Server listens on port 8091 inside the container. However, clients need to access it through the host's port 21908. Currently, both `SEATA_PORT` and `seata.server.service-port` simultaneously control both the listening port and the registration port, making separation impossible. Although `SEATA_IP` already supports overriding the registered IP, there is no corresponding mechanism for the port.
   
   ## Solution
   
   Introduce a new optional configuration `seata.server.registry-port` (environment variable `SEATA_REGISTRY_PORT`) that overrides only the port registered to the service discovery center (Nacos, etc.), without affecting the actual listening port of Netty. Behavior remains completely unchanged if not configured.
   
   ## Main Changes
   
   1.  Extracted the original port resolution logic into `resolveServicePort()` and added a new `resolveRegistryPort()`.
   2.  The resolution priority is: `SEATA_REGISTRY_PORT` environment variable > `seata.server.registry-port` YAML configuration.
   3.  Port replacement occurs only at the two entry points in the registration chain:
       *   `NettyServerBootstrap.start()`
       *   `VGroupMappingStoreManager.notifyMapping()`
   4.  The change takes effect uniformly for all registry centers (Nacos, Eureka, etc.), eliminating the need for individual adaptations in each registry implementation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feature: add registry port config [incubator-seata]

Posted by "ban-xiu (via GitHub)" <gi...@apache.org>.
ban-xiu commented on PR #8017:
URL: https://github.com/apache/incubator-seata/pull/8017#issuecomment-4060227241

   Sorry,I just ran the spotless


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feature: add registry port config [incubator-seata]

Posted by "ban-xiu (via GitHub)" <gi...@apache.org>.
ban-xiu commented on PR #8017:
URL: https://github.com/apache/incubator-seata/pull/8017#issuecomment-4065698503

   @funky-eyes This appears to be an issue with Maven itself, not due to newly added code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feature: add registry port config [incubator-seata]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #8017:
URL: https://github.com/apache/incubator-seata/pull/8017#issuecomment-4060206727

   ## [Codecov](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `35.00000%` with `26 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 72.25%. Comparing base ([`8140d90`](https://app.codecov.io/gh/apache/incubator-seata/commit/8140d90bf0c33b3d6c14e3f247b94a24ed8a86a8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`786a19a`](https://app.codecov.io/gh/apache/incubator-seata/commit/786a19a70ce37b3fa3b6d99256b20024c504b61e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ver/spring/listener/ServerApplicationListener.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fspring%2Flistener%2FServerApplicationListener.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvc3ByaW5nL2xpc3RlbmVyL1NlcnZlckFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | 35.29% | [9 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../seata/server/store/VGroupMappingStoreManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fstore%2FVGroupMappingStoreManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvc3RvcmUvVkdyb3VwTWFwcGluZ1N0b3JlTWFuYWdlci5qYXZh) | 0.00% | [9 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...che/seata/core/rpc/netty/NettyServerBootstrap.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2FNettyServerBootstrap.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvTmV0dHlTZXJ2ZXJCb290c3RyYXAuamF2YQ==) | 50.00% | [3 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...a/org/apache/seata/server/env/ContainerHelper.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fenv%2FContainerHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvZW52L0NvbnRhaW5lckhlbHBlci5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##                2.x    #8017      +/-   ##
   ============================================
   - Coverage     72.28%   72.25%   -0.04%     
     Complexity      876      876              
   ============================================
     Files          1310     1310              
     Lines         49977    50015      +38     
     Branches       5945     5950       +5     
   ============================================
   + Hits          36125    36137      +12     
   - Misses        10900    10924      +24     
   - Partials       2952     2954       +2     
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...ava/org/apache/seata/common/ConfigurationKeys.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=common%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcommon%2FConfigurationKeys.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9jb21tb24vQ29uZmlndXJhdGlvbktleXMuamF2YQ==) | `0.00% <ø> (ø)` | |
   | [...oconfigure/properties/server/ServerProperties.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=seata-spring-autoconfigure%2Fseata-spring-autoconfigure-server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fspring%2Fboot%2Fautoconfigure%2Fproperties%2Fserver%2FServerProperties.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VhdGEtc3ByaW5nLWF1dG9jb25maWd1cmUvc2VhdGEtc3ByaW5nLWF1dG9jb25maWd1cmUtc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zcHJpbmcvYm9vdC9hdXRvY29uZmlndXJlL3Byb3BlcnRpZXMvc2VydmVyL1NlcnZlclByb3BlcnRpZXMuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...a/org/apache/seata/server/env/ContainerHelper.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fenv%2FContainerHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvZW52L0NvbnRhaW5lckhlbHBlci5qYXZh) | `77.77% <0.00%> (-9.73%)` | :arrow_down: |
   | [...che/seata/core/rpc/netty/NettyServerBootstrap.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fcore%2Frpc%2Fnetty%2FNettyServerBootstrap.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Y29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VhdGEvY29yZS9ycGMvbmV0dHkvTmV0dHlTZXJ2ZXJCb290c3RyYXAuamF2YQ==) | `73.58% <50.00%> (-2.71%)` | :arrow_down: |
   | [.../seata/server/store/VGroupMappingStoreManager.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fstore%2FVGroupMappingStoreManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvc3RvcmUvVkdyb3VwTWFwcGluZ1N0b3JlTWFuYWdlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ver/spring/listener/ServerApplicationListener.java](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&filepath=server%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fseata%2Fserver%2Fspring%2Flistener%2FServerApplicationListener.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zZWF0YS9zZXJ2ZXIvc3ByaW5nL2xpc3RlbmVyL1NlcnZlckFwcGxpY2F0aW9uTGlzdGVuZXIuamF2YQ==) | `50.00% <35.29%> (-5.32%)` | :arrow_down: |
   
   ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/apache/incubator-seata/pull/8017/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/incubator-seata/pull/8017/graphs/tree.svg?width=650&height=150&src=pr&token=tbmHt2ZfxO&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/incubator-seata/pull/8017?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feature: add registry port config [incubator-seata]

Posted by "ban-xiu (via GitHub)" <gi...@apache.org>.
ban-xiu commented on PR #8017:
URL: https://github.com/apache/incubator-seata/pull/8017#issuecomment-4115084032

   Please check for any recent updates on this. Thank you for taking the time to review this PR. @funky-eyes 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org


Re: [PR] feature: add registry port config [incubator-seata]

Posted by "ban-xiu (via GitHub)" <gi...@apache.org>.
ban-xiu commented on PR #8017:
URL: https://github.com/apache/incubator-seata/pull/8017#issuecomment-4052297205

   @slievrly @funky-eyes Could you please help review this PR when you have a moment? Thanks a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org