Merge branch '2021.0' into feat/customize-local-port

pull/923/head
Haotian Zhang 3 years ago committed by GitHub
commit 8c3c8553c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,8 +10,27 @@ on:
- greenwich - greenwich
jobs: jobs:
check-snapshot:
runs-on: ubuntu-latest
outputs:
IS_SNAPSHOT: ${{ steps.set_output_1.outputs.IS_SNAPSHOT }}
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Check deploy type
id: set_output_1
run: |
line="$(grep SNAPSHOT pom.xml || true)"
echo $line
if [ -n "$line" ]; then
echo "IS_SNAPSHOT=true" >> $GITHUB_OUTPUT
else
echo "IS_SNAPSHOT=false" >> $GITHUB_OUTPUT
fi
snapshot: snapshot:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: check-snapshot
if: ${{ needs.check-snapshot.outputs.IS_SNAPSHOT == 'true' }}
steps: steps:
- name: Checkout codes - name: Checkout codes
uses: actions/checkout@v3 uses: actions/checkout@v3

@ -1,13 +1,6 @@
# Change Log # Change Log
--- ---
- [fix: fix log feign response stream close bug.](https://github.com/Tencent/spring-cloud-tencent/pull/897)
- [fix:remove the secondary report.](https://github.com/Tencent/spring-cloud-tencent/pull/899)
- [feature: add ratelimit provider info and refactor ratelimit use arguments.](https://github.com/Tencent/spring-cloud-tencent/pull/903)
- [fix:optimize instance circuit beaker.](https://github.com/Tencent/spring-cloud-tencent/pull/909)
- [fix:optimize multi service registration and discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/912)
- [feature: improve circuit breaker usage.](https://github.com/Tencent/spring-cloud-tencent/pull/913)
- [fix:fix nacos and consul registration.](https://github.com/Tencent/spring-cloud-tencent/pull/921)
- [feature: add config for customized local port.](https://github.com/Tencent/spring-cloud-tencent/pull/923) - [feature: add config for customized local port.](https://github.com/Tencent/spring-cloud-tencent/pull/923)
- [Documentation content changes: add circuitbreaker readme.](https://github.com/Tencent/spring-cloud-tencent/pull/930) - [feature: optimize polaris-discovery-example/discovery-callee-service, add client-ip return.](https://github.com/Tencent/spring-cloud-tencent/pull/939)
- [fix: fix PolarisRouterServiceInstanceListSupplier npe with reactive feign.](https://github.com/Tencent/spring-cloud-tencent/pull/926) - [docs:prevent the release of the final version of the sdk.](https://github.com/Tencent/spring-cloud-tencent/pull/943)

@ -35,30 +35,35 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/discovery/service/callee") @RequestMapping("/discovery/service/callee")
public class DiscoveryCalleeController { public class DiscoveryCalleeController {
private static Logger LOG = LoggerFactory.getLogger(DiscoveryCalleeController.class); private static final Logger LOG = LoggerFactory.getLogger(DiscoveryCalleeController.class);
@Value("${server.port:0}") @Value("${server.port:0}")
private int port; private int port;
@Value("${spring.cloud.client.ip-address:127.0.0.1}")
private String ip;
/** /**
* Get information of callee. * Get information of callee.
*
* @return information of callee * @return information of callee
*/ */
@GetMapping("/info") @GetMapping("/info")
public String info() { public String info() {
LOG.info("Discovery Service Callee [{}] is called.", port); LOG.info("Discovery Service Callee [{}:{}] is called.", ip, port);
return String.format("Discovery Service Callee [%s] is called.", port); return String.format("Discovery Service Callee [%s:%s] is called.", ip, port);
} }
/** /**
* Get sum of two value. * Get sum of two value.
*
* @param value1 value 1 * @param value1 value 1
* @param value2 value 2 * @param value2 value 2
* @return sum * @return sum
*/ */
@GetMapping("/sum") @GetMapping("/sum")
public int sum(@RequestParam int value1, @RequestParam int value2) { public int sum(@RequestParam int value1, @RequestParam int value2) {
LOG.info("Discovery Service Callee is called and sum is {}.", value1 + value2); LOG.info("Discovery Service Callee [{}:{}] is called and sum is {}.", ip, port, value1 + value2);
return value1 + value2; return value1 + value2;
} }
} }

Loading…
Cancel
Save