[GitHub] coveralls commented on issue #428: [SCB-807]Limit the topology view to only 100 microservices.
coveralls commented on issue #428: [SCB-807]Limit the topology view to only 100 microservices. URL: https://github.com/apache/incubator-servicecomb-service-center/pull/428#issuecomment-414918925 [![Coverage Status](https://coveralls.io/builds/18603996/badge)](https://coveralls.io/builds/18603996) Coverage decreased (-0.1%) to 76.09% when pulling **dcfbaacb965824121aa4b807aa8340fb179802ec on xiaoyimei:develop** into **9f55487b6ed2a256a5d66fe028c4e986961921e9 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io commented on issue #428: [SCB-807]Limit the topology view to only 100 microservices.
codecov-io commented on issue #428: [SCB-807]Limit the topology view to only 100 microservices. URL: https://github.com/apache/incubator-servicecomb-service-center/pull/428#issuecomment-414918926 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=h1) Report > Merging [#428](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/9f55487b6ed2a256a5d66fe028c4e986961921e9?src=pr=desc) will **decrease** coverage by `0.01%`. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=tree) ```diff @@Coverage Diff @@ ## master #428 +/- ## == - Coverage 72.97% 72.96% -0.02% == Files 128 128 Lines9978 9978 == - Hits 7281 7280 -1 Misses 2221 2221 - Partials 476 477 +1 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=tree) | Coverage Δ | | |---|---|---| | [server/plugin/infra/registry/etcd/tracing.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428/diff?src=pr=tree#diff-c2VydmVyL3BsdWdpbi9pbmZyYS9yZWdpc3RyeS9ldGNkL3RyYWNpbmcuZ28=) | `72.72% <0%> (-9.1%)` | :arrow_down: | | [server/broker/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv) | `53.2% <0%> (-0.27%)` | :arrow_down: | | [server/plugin/infra/registry/etcd/etcd.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428/diff?src=pr=tree#diff-c2VydmVyL3BsdWdpbi9pbmZyYS9yZWdpc3RyeS9ldGNkL2V0Y2QuZ28=) | `86.23% <0%> (+0.19%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=footer). Last update [9f55487...dcfbaac](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/428?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] xiaoyimei opened a new pull request #428: [SCB-807]Limit the topology view to only 100 microservices.
xiaoyimei opened a new pull request #428: [SCB-807]Limit the topology view to only 100 microservices. URL: https://github.com/apache/incubator-servicecomb-service-center/pull/428 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] cherrylzhao closed pull request #262: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao closed pull request #262: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/262 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml index c4916eea..75145e5b 100644 --- a/alpha/alpha-server/pom.xml +++ b/alpha/alpha-server/pom.xml @@ -200,7 +200,7 @@ -spring-boot-2 + spring-boot-2 ${spring.boot2.version} diff --git a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java new file mode 100644 index ..e05b0243 --- /dev/null +++ b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun + */ +public final class GrpcOmegaTccCallback implements OmegaCallback { + + private StreamObserver responseObserver; + + public GrpcOmegaTccCallback(StreamObserver responseObserver) { +this.responseObserver = responseObserver; + } + + @Override + public void compensate(ParticipateEvent event, TransactionStatus status) { +GrpcTccCordinateCommand command = GrpcTccCordinateCommand.newBuilder() +.setGlobalTxId(event.getGlobalTxId()) +.setLocalTxId(event.getLocalTxId()) +.setParentTxId(event.getParentTxId() == null ? "" : event.getParentTxId()) +.setMethod(TransactionStatus.Succeed.equals(status) ? event.getConfirmMethod() : event.getCancelMethod()) +.build(); +responseObserver.onNext(command); + } +} diff --git a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java new file mode 100644 index ..a76530b6 --- /dev/null +++ b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEventFactory; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipateEvent; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent;
[GitHub] coveralls commented on issue #881: [SCB-861]490, 590 response not properly used
coveralls commented on issue #881: [SCB-861]490,590 response not properly used URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/881#issuecomment-414905898 [![Coverage Status](https://coveralls.io/builds/18603420/badge)](https://coveralls.io/builds/18603420) Coverage decreased (-0.008%) to 86.179% when pulling **ddc125bf6450e3872c44d2f95850aac55d4a1779 on liubao68:error_code4** into **3c7f128c9e50239398847126e7857a8db98d85b4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism
coveralls edited a comment on issue #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/876#issuecomment-413496726 [![Coverage Status](https://coveralls.io/builds/18603392/badge)](https://coveralls.io/builds/18603392) Coverage decreased (-0.009%) to 86.178% when pulling **32610f85fee9b5cbe8d00d45951cfc1f05b1265a on zhengyangyong:SCB-849** into **3c7f128c9e50239398847126e7857a8db98d85b4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism
coveralls edited a comment on issue #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/876#issuecomment-413496726 [![Coverage Status](https://coveralls.io/builds/18603355/badge)](https://coveralls.io/builds/18603355) Coverage increased (+0.01%) to 86.2% when pulling **32610f85fee9b5cbe8d00d45951cfc1f05b1265a on zhengyangyong:SCB-849** into **3c7f128c9e50239398847126e7857a8db98d85b4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism
zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/876#discussion_r211821084 ## File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/metrics/SCBHttpServerMetrics.java ## @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package org.apache.servicecomb.foundation.vertx.metrics; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.vertx.ClientEvent; +import org.apache.servicecomb.foundation.vertx.ConnectionEvent; +import org.apache.servicecomb.foundation.vertx.TransportType; + +import io.vertx.core.metrics.impl.DummyVertxMetrics.DummyHttpServerMetrics; +import io.vertx.core.net.SocketAddress; + +public class SCBHttpServerMetrics extends DummyHttpServerMetrics { + + private final AtomicInteger connectedCounter = new AtomicInteger(); + + public AtomicInteger getConnectedCounter() { +return connectedCounter; + } + + @Override + public Void connected(SocketAddress remoteAddress, String remoteName) { +int connectedCount = connectedCounter.incrementAndGet(); +EventManager.post(new ClientEvent(remoteAddress.toString(), Review comment: change name to ServerEvent This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism
zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/876#discussion_r211821127 ## File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/server/TcpServer.java ## @@ -67,19 +61,16 @@ public void init(Vertx vertx, String sslKey, AsyncResultCallback { - int connectedCount = connectedCounter.incrementAndGet(); + int connectedCount = ((SCBTCPMetrics) ((NetSocketImpl) netSocket).metrics()).getConnectedCounter().get(); Review comment: Fixed, return SCBSocketMetrics This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism
zhengyangyong commented on a change in pull request #876: [SCB-849] refactor producer connection limit using vertx metrics spi mechanism URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/876#discussion_r211821070 ## File path: foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/metrics/SCBHttpServerMetrics.java ## @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package org.apache.servicecomb.foundation.vertx.metrics; + +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.servicecomb.foundation.common.event.EventManager; +import org.apache.servicecomb.foundation.vertx.ClientEvent; +import org.apache.servicecomb.foundation.vertx.ConnectionEvent; +import org.apache.servicecomb.foundation.vertx.TransportType; Review comment: Fixed This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-docs] 01/03: translate java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 71beec515a3be6068a90d2166b91d06c88cbd204 Author: DeanLee AuthorDate: Tue Aug 21 15:52:27 2018 +0800 translate java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md --- .../configuration/downgrade-strategy.md| 101 +++-- 1 file changed, 33 insertions(+), 68 deletions(-) diff --git a/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md b/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md index 2a02d2f..9543646 100644 --- a/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md +++ b/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md @@ -1,78 +1,46 @@ -## 概念阐述 +## Fallback Policy -降级策略是当服务请求异常时,微服务所采用的异常处理策略。 +### Concept Description -降级策略有三个相关的技术概念:“隔离”、“熔断”、“容错”: +A fallback policy is used when a service request is abnormal. -* “隔离”是一种异常检测机制,常用的检测方法是请求超时、流量过大等。一般的设置参数包括超时时间、同时并发请求个数等。 -* “熔断”是一种异常反应机制,“熔断”依赖于“隔离”。熔断通常基于错误率来实现。一般的设置参数包括统计请求的个数、错误率等。 -* “容错”是一种异常处理机制,“容错”依赖于“熔断”。熔断以后,会调用“容错”的方法。一般的设置参数包括调用容错方法的次数等。 +There are three key concepts in fallback: isolation, fallbreak, and fault tolerance: -把这些概念联系起来:当"隔离"措施检测到N次请求中共有M次错误的时候,"熔断"不再发送后续请求,调用"容错"处理函数。这个技术上的定义,是和Netflix Hystrix一致的,通过这个定义,非常容易理解它提供的配置项,参考:[https://github.com/Netflix/Hystrix/wiki/Configuration](https://github.com/Netflix/Hystrix/wiki/Configuration)。当前ServiceComb提供两种容错方式,分别为返回null值和抛出异常。 +* Isolation is an exception detection mechanism. Two common items that need to be detected are timeout duration and the number of concurrent requests. +* Fallbreak is an exception response mechanism, and it depends on isolation. Fallbreak is triggered based on the error rate. Two common items need to set are the number of requests to collect and error rate. +* Fault tolerance is an exception handling mechanism that depends on fallbreak. Fault tolerance is called after a fallbreak. For fault tolerance, you need to set the number of fault tolerance call items. -## 场景描述 +During fallback, if M(the threshold) errors are detected in N requests, the consumer will no longer send requests and the fault tolerance mechanism will be enabled. The preceding fallback process is accepted in Netflix Hystrix and helps you configure the parameters. Obtain information about the parameter configuration at [https://github.com/Netflix/Hystrix/wiki/Configuration](https://github.com/Netflix/Hystrix/wiki/Configuration). Currently, ServiceComb provides two types of fault toler [...] -用户通过配置降级策略,可以设置微服务的异常处理策略。 +### Scenario -## 配置说明 +By configuring a fallback policy, you can handler microservice exceptions. -配置项支持对所有接口生效,或者对某个微服务的某个具体方法生效。 +### Configuration -### 配置项生效范围 + Configuration items of fallback policies are as follows: -* 按照类型\(type\):配置项能够针对Provider, Consumer进行配置 + **Table 3 Configuration items of the fallback policy** -* 按照范围\(scope\):配置项能够针对MicroService进行配置, 也可以针对【x-schema-id + operationId】进行配置 +| Configuration Item | Default value | Value Range | Mandatory | Description | Remarks | +| :--- | :- | : | : | :--- | :--- | +| servicecomb.isolation.timeout.enabled| FALSE | - | No| Specifies whether to enable timeout detection. | | +| servicecomb.isolation.timeoutInMilliseconds | 3 | - | No| Specifies the timeout duration threshold. | | +| servicecomb.isolation.maxConcurrentRequests | 10 | - | No| Specifies the maximum number of concurrent requests. | | +| servicecomb.circuitBreaker.enabled | TRUE | - | No| Specifies whether to enable fallbreak. | | +| servicecomb.circuitBreaker.forceOpen | FALSE | - | No| Specifies that fallbreak is enable regardless of the number of failed requests or the error rate. | | +| servicecomb.circuitBreaker.forceClosed | FALSE | - | No| Specifies that fallbreak can be implemented at any time. | If this parameter and servicecomb.circuitBreaker.forceOpen both need to be configured, servicecomb.circuitBreaker.forceOpen has priority. |
[GitHub] liubao68 closed pull request #42: Migration configuration from web repo
liubao68 closed pull request #42: Migration configuration from web repo URL: https://github.com/apache/incubator-servicecomb-docs/pull/42 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md b/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md index 2a02d2f..9543646 100644 --- a/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md +++ b/java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md @@ -1,78 +1,46 @@ -## 概念阐述 +## Fallback Policy -降级策略是当服务请求异常时,微服务所采用的异常处理策略。 +### Concept Description -降级策略有三个相关的技术概念:“隔离”、“熔断”、“容错”: +A fallback policy is used when a service request is abnormal. -* “隔离”是一种异常检测机制,常用的检测方法是请求超时、流量过大等。一般的设置参数包括超时时间、同时并发请求个数等。 -* “熔断”是一种异常反应机制,“熔断”依赖于“隔离”。熔断通常基于错误率来实现。一般的设置参数包括统计请求的个数、错误率等。 -* “容错”是一种异常处理机制,“容错”依赖于“熔断”。熔断以后,会调用“容错”的方法。一般的设置参数包括调用容错方法的次数等。 +There are three key concepts in fallback: isolation, fallbreak, and fault tolerance: -把这些概念联系起来:当"隔离"措施检测到N次请求中共有M次错误的时候,"熔断"不再发送后续请求,调用"容错"处理函数。这个技术上的定义,是和Netflix Hystrix一致的,通过这个定义,非常容易理解它提供的配置项,参考:[https://github.com/Netflix/Hystrix/wiki/Configuration](https://github.com/Netflix/Hystrix/wiki/Configuration)。当前ServiceComb提供两种容错方式,分别为返回null值和抛出异常。 +* Isolation is an exception detection mechanism. Two common items that need to be detected are timeout duration and the number of concurrent requests. +* Fallbreak is an exception response mechanism, and it depends on isolation. Fallbreak is triggered based on the error rate. Two common items need to set are the number of requests to collect and error rate. +* Fault tolerance is an exception handling mechanism that depends on fallbreak. Fault tolerance is called after a fallbreak. For fault tolerance, you need to set the number of fault tolerance call items. -## 场景描述 +During fallback, if M(the threshold) errors are detected in N requests, the consumer will no longer send requests and the fault tolerance mechanism will be enabled. The preceding fallback process is accepted in Netflix Hystrix and helps you configure the parameters. Obtain information about the parameter configuration at [https://github.com/Netflix/Hystrix/wiki/Configuration](https://github.com/Netflix/Hystrix/wiki/Configuration). Currently, ServiceComb provides two types of fault tolerance modes: returning null values and throwing exceptions. -用户通过配置降级策略,可以设置微服务的异常处理策略。 +### Scenario -## 配置说明 +By configuring a fallback policy, you can handler microservice exceptions. -配置项支持对所有接口生效,或者对某个微服务的某个具体方法生效。 +### Configuration -### 配置项生效范围 + Configuration items of fallback policies are as follows: -* 按照类型\(type\):配置项能够针对Provider, Consumer进行配置 + **Table 3 Configuration items of the fallback policy** -* 按照范围\(scope\):配置项能够针对MicroService进行配置, 也可以针对【x-schema-id + operationId】进行配置 +| Configuration Item | Default value | Value Range | Mandatory | Description | Remarks | +| :--- | :- | : | : | :--- | :--- | +| servicecomb.isolation.timeout.enabled| FALSE | - | No| Specifies whether to enable timeout detection. | | +| servicecomb.isolation.timeoutInMilliseconds | 3 | - | No| Specifies the timeout duration threshold. | | +| servicecomb.isolation.maxConcurrentRequests | 10 | - | No| Specifies the maximum number of concurrent requests. | | +| servicecomb.circuitBreaker.enabled | TRUE | - | No| Specifies whether to enable fallbreak. | | +| servicecomb.circuitBreaker.forceOpen | FALSE | - | No| Specifies that fallbreak is enable regardless of the number of failed requests or the error rate. | | +| servicecomb.circuitBreaker.forceClosed | FALSE | - | No| Specifies that fallbreak can be implemented at any time. | If this parameter and servicecomb.circuitBreaker.forceOpen both need to be configured, servicecomb.circuitBreaker.forceOpen has priority. | +| servicecomb.circuitBreaker.sleepWindowInMilliseconds | 15000
[incubator-servicecomb-docs] 03/03: translate java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 2562a9871303ccbf6478eef7cfd52b9548a4d862 Author: DeanLee AuthorDate: Tue Aug 21 15:52:59 2018 +0800 translate java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md --- .../configuration/ratelimite-strategy.md | 86 +++--- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md b/java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md index 5d4dca5..067ccc8 100644 --- a/java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md +++ b/java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md @@ -1,41 +1,45 @@ -## 场景描述 - -用户在provider端使用限流策略,可以限制指定微服务向其发送请求的频率,达到限制每秒钟最大请求数量的效果。 - -## 注意事项 - -1. 限流策略的控制并不是绝对精确的,可能会有少量误差。 -2. provider端的流量控制是业务层面的功能,不是安全意义上的流量控制,如需防止DDoS攻击,需要结合其他的一系列措施。 -3. 流量控制是微服务级的,不是实例级的。例如一个consumer服务有三个实例,当对它们依赖的provider实例配置限流策略后,provider不会区分consumer的请求具体是由哪个实例发出的,而是汇总成微服务级的统计数据进行限流判断。 - -## 配置说明 - -限流策略配置在microservice.yaml文件中,相关配置项见表**QPS流控配置项说明**。要开启服务提供者端的限流策略,还需要在处理链中配置服务端限流handler,并添加pom依赖。 - -* microservice.yaml配置示例如下: - ```yaml - servicecomb: -handler: - chain: -Provider: - default: qps-flowcontrol-provider - ``` -* 添加handler-flowcontrol-qps的pom依赖: - ```xml - - org.apache.servicecomb - handler-flowcontrol-qps - 1.0.0.B003 - - ``` - -**QPS流控配置项说明** - -| 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | -| :--- | :--- | :--- | :--- | :--- | :--- | -| servicecomb.flowcontrol.Provider.qps.enabled | true | true/false | 否 | 是否启用Provider流控 | - | -| servicecomb.flowcontrol.Provider.qps.limit.\[ServiceName\].\[Schema\].\[operation\] | 2147483647(max int) | \(0,2147483647\],整形 | 否 | 每秒钟允许的请求数 | 支持microservice/schema/operation三个级别的配置,后者的优先级高于前者 | -| servicecomb.flowcontrol.Provider.qps.global.limit | 2147483647(max int) | \(0,2147483647\],整形 | 否 | provider接受请求流量的全局配置 | 没有具体的流控配置时,此配置生效 | - -> **注意:** -> provider端限流策略配置中的`ServiceName`指的是调用该provider的consumer,而`shema`、`operation`指的是provider自身的。即provider端限流配置的含义是,限制指定consumer调用本provider的某个schema、operation的流量。 + +## Rate Limiting Policy +### Scenario + +Users at the provider end can use the rate limiting policy to limit the maximum number of requests sent from a specified microservice per second. + +### Precautions + +1. There may be a small different between the rate limit and actual traffic. +2. The rate limit function at the provider end is for service rather than security purpose. To prevent distributed denial of service(DDos) attacks, you need to take other measures. +3. Traffic control is a microservice-level rather than process-level function. + +### Configuration + + Rate limiting policies are configured in the microservice.yaml file. For related configuration items, see Table 2. To enable the rate limiting policy at the provider end, you also need to configure the rate limiting handler on the server in the processing chain and add dependencies in the pom.xml file. + + An example of microservice.yaml file configuration is as follows, + +```yaml +servicecomb: + handler: +chain: + Provider: +default: qps-flowcontrol-provider +``` + + Add dependencies of handler-flowcontrol-qps in the pom.xml file, + +```xml + +org.apache.servicecomb +handler-flowcontrol-qps +1.0.0-m1 + +``` + + **Table2 Configuration items of the QPS rate limit** + +| Configuration Item | Default Value | Value Range | Mandatory | Description | Remarks | +| :--- | :-- | :--- | : | :--- | :--- | +| servicecomb.flowcontrol.Provider.qps.enabled | true| true/false | No| Specifies whether to enable traffic control at the provider end. | -| +| servicecomb.flowcontrol.Provider.qps.limit.\[ServiceName\] | 2147483647(max int) | \(0,2147483647\],Integer | No| Specifies the number of requests allowed per second. | This parameter can only be configured for microservice | +| servicecomb.flowcontrol.Provider.qps.global.limit | 2147483647(max int) | (0,2147483647\],Integer | No| Specifies the total number of requests allowed per second at the provider end | If no configuration is set for any specific microservices, this parameter takes effect | + +## \ No newline at end of file
[incubator-servicecomb-docs] branch master updated (a376c20 -> 2562a98)
This is an automated email from the ASF dual-hosted git repository. liubao pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git. from a376c20 correct web-container.md and standalone.md translate issue new 71beec5 translate java-chassis-reference/en_US/build-provider/configuration/downgrade-strategy.md new 8abb342 translate java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md new 2562a98 translate java-chassis-reference/en_US/build-provider/configuration/ratelimite-strategy.md The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../configuration/downgrade-strategy.md| 101 +++-- .../build-provider/configuration/lb-strategy.md| 76 +++- .../configuration/ratelimite-strategy.md | 86 +- 3 files changed, 113 insertions(+), 150 deletions(-)
[incubator-servicecomb-docs] 02/03: translate java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 8abb3429514455ae12bf1f880c1582baecc37edc Author: DeanLee AuthorDate: Tue Aug 21 15:52:44 2018 +0800 translate java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md --- .../build-provider/configuration/lb-strategy.md| 76 ++ 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md b/java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md index 9028584..64668c5 100644 --- a/java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md +++ b/java-chassis-reference/en_US/build-provider/configuration/lb-strategy.md @@ -1,35 +1,34 @@ -## 场景描述 +## Load Balancing Policy +### Scenario -ServiceComb提供了基于Ribbon的负载均衡方案,用户可以通过配置文件配置负载均衡策略,当前支持随机、顺序、基于响应时间的权值等多种负载均衡路由策略。 + ServiceComb provides a Ribbon-based load balancing solution. You can configure a load balancing policy in the configuration file. Currently, a load balancing routing policy can be random, sequential, or based on response time weight. -## 配置说明 +### Configuration -负载均衡策略在mocroservice.yaml文件中配置,配置项为`servicecomb.loadbalance.[MicroServiceName].[property name]`,其中若省略MicroServiceName,则为全局配置;若指定MicroServiceName,则为针对特定微服务的配置。 + Load balancing policies are configured by setting the parameter `servicecomb.loadbalance.[MicroServiceName].[property name]` in the microservice.yaml fiel. If MicroServiceName is not set, the configuration is set for all microservices. Otherwise, the configuration is set for a specific microservice. -表1-1配置项说明 + **Table 1 Configuration items of load balancing policy** -| 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | -| :--- | :--- | :--- | :--- | :--- | :--- | -| servicecomb.loadbalance.\[服务名\].strategy.name | RoundRobin | RoundRobin(轮询)Random(随机)WeightedResponse(服务器响应时间权值)SessionStickiness(会话保持) | 否 | 负载均衡路由策略 | - | -| servicecomb.loadbalance.\[服务名\].SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | 否 | 客户端闲置时间,超过限制后选择后面的服务器。 | - | -| servicecomb.loadbalance.\[服务名\].SessionStickinessRule.successiveFailedTimes | 5 | Integer | 否 | 客户端失败次数,超过后会切换服务器 | - | -| servicecomb.loadbalance.\[服务名\].retryEnabled | FALSE | Boolean | 否 | 负载均衡捕获到服务调用异常,是否进行重试 | - | -| servicecomb.loadbalance.\[服务名\].retryOnNext | 0 | Integer | 否 | 尝试新的服务器的次数 | - | -| servicecomb.loadbalance.\[服务名\].retryOnSame | 0 | Integer | 否 | 同一个服务器尝试的次数 | - | -| servicecomb.loadbalance.\[服务名\].isolation.enabled | FALSE | Boolean | 否 | 是否开启故障实例隔离功能 | - | -| servicecomb.loadbalance.\[服务名\].isolation.enableRequestThreshold | 20 | Integer | 否 | 当实例的调用总次数达到该值时开始进入隔离逻辑门槛 | - | -| servicecomb.loadbalance.\[服务名\].isolation.continuousFailureThreshold | - | Integer | 否 | 当请求实例连续出错达到此阈值时触发实例隔离 | 若配置了此项则覆盖实例故障百分比的配置,否则按照实例故障百分比触发隔离。由于按请求错误率触发实例隔离在请求次数较多时不易触发也不易恢复,因此建议使用此配置项代替实例故障百分比配置。请求实例成功时会将连续错误次数请零以保证实例快速恢复。 | -| servicecomb.loadbalance.\[服务名\].isolation.errorThresholdPercentage | 20 | Integer,区间为\(0,100\] | 否 | 实例故障隔离错误百分比 | - | -| servicecomb.loadbalance.\[服务名\].isolation.singleTestTime | 1 | Integer | 否 | 故障实例单点测试时间 | 单位为ms | +| Configuration Items | Default Value | Value Range | Mandatory | Description | Remarks | +| :--- | :--- | :--- | : | :--- | :--- | +| servicecomb.loadbalance.NFLoadBalancerRuleClassName | com.netflix.loadbalancer.RoundRobinRule | com.netflix.loadbalancer.RoundRobinRule(polling)com.netflix.loadbalancer.RandomRule(random)com.netflix.loadbalancer.WeightedResponseTimeRule(server response time weight)org.apache.servicecomb.loadbalance.SessionStickinessRule(session stickiness) | No| Specifiles the load balancing policy | - | +| servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds | 30 | Integer | No| Specifies the idle time of a client. If the idle time exceeds the set value, ServiceComb will select another server. | Currently, this parameter cannot be set for a certain microservice. For example, servicecomb.loadbalance.SessionStickinessRule.sessionTimeoutInSeconds cannot be set to servicecomb.loadbalance.DemoServi [...] +| servicecomb.loadbalance.SessionStickinessRule.successiveFailedTimes | 5 | Integer | No| Specifies the number of failed requests from the client. If the number exceeds the set value,
[GitHub] liubao68 commented on a change in pull request #39: References handlers dir translation
liubao68 commented on a change in pull request #39: References handlers dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/39#discussion_r211820815 ## File path: java-chassis-reference/en_US/references-handlers/loadbalance.md ## @@ -57,40 +58,35 @@ servicecomb: options: tag: mytag ``` -上面的配置表示只访问myservice所有实例中tag属性为mytag的实例。 +The above configuration means that only instances with the tag attribute mytag in all instances of myservice are accessed. -该规则需要给每个服务单独配置,未配置表示不启用该规则,不支持对于所有服务的全局配置。 +This rule needs to be configured separately for each service. Unconfigured means that the rule is not enabled and global configuration for all services is not supported. -该规则默认启用,如果不需要使用,可以通过servicecomb.loadbalance.filter.instanceProperty.enabled进行关闭。根据实例属性进行路由转发功能在InstancePropertyDiscoveryFilter实现。 +This rule is enabled by default. If it is not needed, it can be closed by servicecomb.loadbalance.filter.instanceProperty.enabled. The route forwarding function based on the instance attribute is implemented in InstancePropertyDiscoveryFilter. -## 实例隔离功能 -开发者可以配置实例隔离的参数,以暂时屏蔽对于错误实例的访问,提升系统可靠性和性能。下面是其配置项和缺省值 +## Instance isolation +Developers can configure instance-isolated parameters to temporarily mask access to the wrong instance, improving system reliability and performance. Below are its configuration items and default values ``` servicecomb: loadbalance: isolation: enabled: true - errorThresholdPercentage: 0 + errorThresholdPercentage: 20 Review comment: This should be 0 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] wujimin opened a new pull request #44: improve description of rest-over-servlet
wujimin opened a new pull request #44: improve description of rest-over-servlet URL: https://github.com/apache/incubator-servicecomb-docs/pull/44 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] liubao68 opened a new pull request #881: [SCB-861]490, 590 response not properly used
liubao68 opened a new pull request #881: [SCB-861]490,590 response not properly used URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/881 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io edited a comment on issue #423: SCB-857 Provider rule of consumer can not be removed
codecov-io edited a comment on issue #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423#issuecomment-414342799 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=h1) Report > Merging [#423](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/9f55487b6ed2a256a5d66fe028c4e986961921e9?src=pr=desc) will **decrease** coverage by `4.16%`. > The diff coverage is `40%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/graphs/tree.svg?width=650=150=pr=GAaF7zrg8R)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=tree) ```diff @@Coverage Diff@@ ## master#423 +/- ## = - Coverage 72.97% 68.8% -4.17% = Files 128 139 +11 Lines9978 10779 +801 = + Hits 72817417 +136 - Misses 22212883 +662 - Partials 476 479 +3 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=tree) | Coverage Δ | | |---|---|---| | [pkg/util/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-cGtnL3V0aWwvdXRpbC5nbw==) | `59.45% <0%> (-3.05%)` | :arrow_down: | | [server/service/dependency.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvZGVwZW5kZW5jeS5nbw==) | `73.17% <100%> (ø)` | :arrow_up: | | [server/core/backend/parser.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvYmFja2VuZC9wYXJzZXIuZ28=) | `99.21% <100%> (+0.12%)` | :arrow_up: | | [server/core/key\_generator.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL2NvcmUva2V5X2dlbmVyYXRvci5nbw==) | `14.28% <100%> (ø)` | | | [server/service/event/dependency\_event\_handler.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvZGVwZW5kZW5jeV9ldmVudF9oYW5kbGVyLmdv) | `15.31% <21.87%> (ø)` | | | [server/service/util/dependency\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kZXBlbmRlbmN5X3V0aWwuZ28=) | `44.47% <25.35%> (-5.14%)` | :arrow_down: | | [server/service/util/dependency.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kZXBlbmRlbmN5Lmdv) | `37.2% <75%> (ø)` | :arrow_up: | | [server/admin/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL2FkbWluL3NlcnZpY2UuZ28=) | `88.23% <0%> (-2.95%)` | :arrow_down: | | [pkg/gopool/goroutines.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-cGtnL2dvcG9vbC9nb3JvdXRpbmVzLmdv) | `97.36% <0%> (-2.64%)` | :arrow_down: | | ... and [13 more](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree-more) | | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=footer). Last update [9f55487...b2158b3](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls commented on issue #423: SCB-857 Provider rule of consumer can not be removed
coveralls commented on issue #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423#issuecomment-414895387 [![Coverage Status](https://coveralls.io/builds/18602986/badge)](https://coveralls.io/builds/18602986) Coverage decreased (-4.5%) to 71.667% when pulling **b2158b3d04d8f2dbb89eaac2b841b6204679fd8b on little-cui:deps** into **9f55487b6ed2a256a5d66fe028c4e986961921e9 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io commented on issue #427: SCB-862 Using different environment variables in image
codecov-io commented on issue #427: SCB-862 Using different environment variables in image URL: https://github.com/apache/incubator-servicecomb-service-center/pull/427#issuecomment-414891080 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=h1) Report > Merging [#427](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/9f55487b6ed2a256a5d66fe028c4e986961921e9?src=pr=desc) will **not change** coverage. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427/graphs/tree.svg?token=GAaF7zrg8R=pr=150=650)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=tree) ```diff @@ Coverage Diff @@ ## master #427 +/- ## === Coverage 72.97% 72.97% === Files 128 128 Lines9978 9978 === Hits 7281 7281 Misses 2221 2221 Partials 476 476 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=tree) | Coverage Δ | | |---|---|---| | [pkg/util/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427/diff?src=pr=tree#diff-cGtnL3V0aWwvdXRpbC5nbw==) | `61.11% <0%> (-1.39%)` | :arrow_down: | | [server/broker/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv) | `53.2% <0%> (-0.27%)` | :arrow_down: | | [server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv) | `73.66% <0%> (+0.33%)` | :arrow_up: | | [server/service/notification/websocket.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3dlYnNvY2tldC5nbw==) | `84.51% <0%> (+0.64%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=footer). Last update [9f55487...b4c1199](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/427?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls commented on issue #427: SCB-862 Using different environment variables in image
coveralls commented on issue #427: SCB-862 Using different environment variables in image URL: https://github.com/apache/incubator-servicecomb-service-center/pull/427#issuecomment-414891041 [![Coverage Status](https://coveralls.io/builds/18602795/badge)](https://coveralls.io/builds/18602795) Coverage decreased (-0.008%) to 76.177% when pulling **b4c1199aa1fa9930d89a639ab023d0322afceffe on little-cui:script** into **9f55487b6ed2a256a5d66fe028c4e986961921e9 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] little-cui commented on issue #423: SCB-857 Provider rule of consumer can not be removed
little-cui commented on issue #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423#issuecomment-414890952 @asifdxtreme , here is an official etcd-operator helm template package, not a binary This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls commented on issue #426: build script for docker image gives an error
coveralls commented on issue #426: build script for docker image gives an error URL: https://github.com/apache/incubator-servicecomb-service-center/pull/426#issuecomment-414888661 [![Coverage Status](https://coveralls.io/builds/18602690/badge)](https://coveralls.io/builds/18602690) Coverage decreased (-0.2%) to 76.024% when pulling **2110dd281204a1fff71772e81070525de5505b71 on little-cui:docker** into **9f55487b6ed2a256a5d66fe028c4e986961921e9 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] little-cui opened a new pull request #427: Docker hub 中的service center 镜像说明需要优化
little-cui opened a new pull request #427: Docker hub 中的service center 镜像说明需要优化 URL: https://github.com/apache/incubator-servicecomb-service-center/pull/427 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- #424 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io commented on issue #426: build script for docker image gives an error
codecov-io commented on issue #426: build script for docker image gives an error URL: https://github.com/apache/incubator-servicecomb-service-center/pull/426#issuecomment-414888644 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=h1) Report > Merging [#426](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/9f55487b6ed2a256a5d66fe028c4e986961921e9?src=pr=desc) will **decrease** coverage by `0.01%`. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426/graphs/tree.svg?width=650=150=pr=GAaF7zrg8R)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=tree) ```diff @@Coverage Diff @@ ## master #426 +/- ## == - Coverage 72.97% 72.96% -0.02% == Files 128 128 Lines9978 9978 == - Hits 7281 7280 -1 Misses 2221 2221 - Partials 476 477 +1 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=tree) | Coverage Δ | | |---|---|---| | [pkg/util/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426/diff?src=pr=tree#diff-cGtnL3V0aWwvdXRpbC5nbw==) | `61.11% <0%> (-1.39%)` | :arrow_down: | | [server/broker/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv) | `53.2% <0%> (-0.27%)` | :arrow_down: | | [server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv) | `73.66% <0%> (+0.33%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=footer). Last update [9f55487...2110dd2](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/426?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] little-cui commented on issue #426: build script for docker image gives an error
little-cui commented on issue #426: build script for docker image gives an error URL: https://github.com/apache/incubator-servicecomb-service-center/pull/426#issuecomment-414886257 #425 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] little-cui opened a new pull request #426: build script for docker image gives an error #425
little-cui opened a new pull request #426: build script for docker image gives an error #425 URL: https://github.com/apache/incubator-servicecomb-service-center/pull/426 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls edited a comment on issue #410: [SCB-812]Change the readme under the frontend folder
coveralls edited a comment on issue #410: [SCB-812]Change the readme under the frontend folder URL: https://github.com/apache/incubator-servicecomb-service-center/pull/410#issuecomment-410669867 [![Coverage Status](https://coveralls.io/builds/18602161/badge)](https://coveralls.io/builds/18602161) Coverage increased (+0.04%) to 76.222% when pulling **44ff60a260c1c40fbd7a4da835894c48826e1b5f on xiaoyimei:master** into **9f55487b6ed2a256a5d66fe028c4e986961921e9 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] codecov-io edited a comment on issue #410: [SCB-812]Change the readme under the frontend folder
codecov-io edited a comment on issue #410: [SCB-812]Change the readme under the frontend folder URL: https://github.com/apache/incubator-servicecomb-service-center/pull/410#issuecomment-410669812 # [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=h1) Report > Merging [#410](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=desc) into [master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/9f55487b6ed2a256a5d66fe028c4e986961921e9?src=pr=desc) will **increase** coverage by `0.03%`. > The diff coverage is `n/a`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/graphs/tree.svg?token=GAaF7zrg8R=650=150=pr)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=tree) ```diff @@ Coverage Diff@@ ## master #410 +/- ## + Coverage 72.97%73% +0.03% Files 128128 Lines9978 9978 + Hits 7281 7284 +3 Misses 2221 2221 + Partials 476473 -3 ``` | [Impacted Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=tree) | Coverage Δ | | |---|---|---| | [pkg/util/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/diff?src=pr=tree#diff-cGtnL3V0aWwvdXRpbC5nbw==) | `61.11% <0%> (-1.39%)` | :arrow_down: | | [server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv) | `73.66% <0%> (+0.33%)` | :arrow_up: | | [server/service/tag.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdGFnLmdv) | `68.94% <0%> (+0.62%)` | :arrow_up: | | [server/service/notification/websocket.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3dlYnNvY2tldC5nbw==) | `84.51% <0%> (+0.64%)` | :arrow_up: | | [pkg/util/tree.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410/diff?src=pr=tree#diff-cGtnL3V0aWwvdHJlZS5nbw==) | `84.37% <0%> (+3.12%)` | :arrow_up: | -- [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=footer). Last update [9f55487...44ff60a](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/410?src=pr=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] asifdxtreme opened a new issue #425: build script for docker image gives an error
asifdxtreme opened a new issue #425: build script for docker image gives an error URL: https://github.com/apache/incubator-servicecomb-service-center/issues/425 ``` # cd scripts/docker/build-image/ root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# ll total 24 drwxr-xr-x 2 root root 4096 Aug 21 22:03 ./ drwxr-xr-x 4 root root 4096 Aug 21 22:03 ../ -rw-r--r-- 1 root root 929 Aug 21 22:03 Dockerfile.tmpl -rw-r--r-- 1 root root 565 Aug 21 22:03 README.md -rw-r--r-- 1 root root 2013 Aug 21 22:03 build.sh -rw-r--r-- 1 root root 1140 Aug 21 22:03 start.sh root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# root@k8smaster:~/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image# bash -x build.sh + set -e + umask 027 +++ dirname build.sh ++ cd . ++ pwd + SCRIPT_DIR=/root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image + BASE_DIR=/root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../../../ + PACKAGE=latest + PACKAGE_PREFIX=apache-servicecomb-incubating-service-center + PACKAGE_DIR=/root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../apache-servicecomb-incubating-service-center-latest-linux-amd64 + source /root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../../build/tools.sh ++ set -e + '[' '!' -d /root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../apache-servicecomb-incubating-service-center-latest-linux-amd64 ']' + docker_builder_pattern /root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../../../ /root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../ + local dockerfile_dir=/root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../../../ + local output=/root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../ + local builder_name=servicecomb/service-center:build + local builder_path=/go/src/github.com/apache/incubator-servicecomb-service-center + local app=apache-servicecomb-incubating-service-center-latest-linux-amd64 + set +e + docker rmi servicecomb/service-center:build Error response from daemon: No such image: servicecomb/service-center:build + set -e + cd /root/asif/src/github.com/apache/incubator-servicecomb-service-center/scripts/docker/build-image/../../../ + docker build -t servicecomb/service-center:build . -f Dockerfile.build Sending build context to Docker daemon 136.7 MB Step 1/4 : FROM golang:1.8.3 1.8.3: Pulling from library/golang aa18ad1a0d33: Pull complete 15a33158a136: Pull complete f67323742a64: Pull complete 1b4531640cb0: Pull complete 3e7f1f935f2c: Pull complete a4db2a724d81: Pull complete 9a798ef77d30: Pull complete Digest: sha256:32c769bf92205580d6579d5b93c3c705f787f6c648105f00bb88a35024c7f8e4 Status: Downloaded newer image for golang:1.8.3 ---> 7e62a8729fa7 Step 2/4 : WORKDIR /go/src/github.com/apache/incubator-servicecomb-service-center ---> 0fb61925899d Removing intermediate container df38d8734a36 Step 3/4 : COPY . . ---> 3b9a70a894ec Removing intermediate container 596ba7399447 Step 4/4 : RUN bash -x scripts/build/local.sh linux 1.0.0 latest ---> Running in 220a5f4867a7 + set -e + export GOOS=linux + GOOS=linux + export GOARCH=amd64 + GOARCH=amd64 + RELEASE=1.0.0 + PACKAGE=latest + PACKAGE_PREFIX=apache-servicecomb-incubating-service-center +++ dirname scripts/build/local.sh ++ cd scripts/build ++ pwd + script_path=/go/src/github.com/apache/incubator-servicecomb-service-center/scripts/build + source /go/src/github.com/apache/incubator-servicecomb-service-center/scripts/build/tools.sh ++ set -e + personal_build + source /go/src/github.com/apache/incubator-servicecomb-service-center/scripts/build/deps.sh ++ set -e dirname scripts/build/local.sh +++ cd scripts/build +++ pwd ++ script_path=/go/src/github.com/apache/incubator-servicecomb-service-center/scripts/build ++ project_path=/go/src/github.com/apache/incubator-servicecomb-service-center/scripts/build/../.. ++ source
[GitHub] asifdxtreme commented on issue #422: No 1.0.0 release tag in Docker hub.
asifdxtreme commented on issue #422: No 1.0.0 release tag in Docker hub. URL: https://github.com/apache/incubator-servicecomb-service-center/issues/422#issuecomment-414715569 @veily Thanks for pointing out this issue, We will be update the docker image soon This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] coveralls commented on issue #262: SCB-865 Implement reaction of the event in Alpha Server
coveralls commented on issue #262: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/262#issuecomment-414714546 [![Coverage Status](https://coveralls.io/builds/18591359/badge)](https://coveralls.io/builds/18591359) Coverage decreased (-2.7%) to 88.061% when pulling **317ce4abd7c59d49c9ace29f761ca56c91dac06e on cherrylzhao:SCB-665** into **7718071b991f13b5ca293c7e7543ac2b9102a2a4 on apache:SCB-665**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] asifdxtreme commented on issue #424: Docker hub 中的service center 镜像说明需要优化
asifdxtreme commented on issue #424: Docker hub 中的service center 镜像说明需要优化 URL: https://github.com/apache/incubator-servicecomb-service-center/issues/424#issuecomment-414714965 @veily Thanks for pointing out this issue, recently there were some changes in the build script so the Dockerfile was moved. I have updated the link in the docker hub page, and for the issue 2 & 3 we will work on it and provide the fix in coming release, we will be more than happy if you are willing to submit the fix for this :) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] asifdxtreme edited a comment on issue #423: SCB-857 Provider rule of consumer can not be removed
asifdxtreme edited a comment on issue #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423#issuecomment-414709704 integration/k8s/service-center/charts/etcd/charts/etcd-operator-0.8.0.tgz @little-cui does this binary needs to be included in the project Generally we don't encourage any binaries in the project This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] asifdxtreme commented on issue #423: SCB-857 Provider rule of consumer can not be removed
asifdxtreme commented on issue #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423#issuecomment-414709704 integration/k8s/service-center/charts/etcd/charts/etcd-operator-0.8.0.tgz @little-cui does this binary needs to be included in the project This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-saga] 07/07: SCB-818 Omega supports of TCC (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 6a70e60d5280800b9a008074aa08e984d9d20256 Author: Willem Jiang AuthorDate: Tue Aug 21 10:25:13 2018 +0800 SCB-818 Omega supports of TCC (WIP) --- .../omega/transaction/tcc/TccEventService.java | 25 - .../transaction/tcc/TccParticipatorAspect.java | 14 ++-- .../tcc/TccStartAnnotationProcessor.java | 26 ++ .../saga/omega/transaction/tcc/TccStartAspect.java | 4 ++-- .../transaction/tcc/events/ParticipatedEvent.java | 10 ++--- .../transaction/tcc/events/TccEndedEvent.java | 4 ++-- .../transaction/tcc/events/TccStartedEvent.java| 4 ++-- 7 files changed, 61 insertions(+), 26 deletions(-) diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java index 1649620..ae011bc 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java @@ -1,4 +1,27 @@ package org.apache.servicecomb.saga.omega.transaction.tcc; -public class TccService { +import org.apache.servicecomb.saga.omega.transaction.AlphaResponse; +import org.apache.servicecomb.saga.omega.transaction.TxEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent; + +public interface TccEventService { + + void onConnected(); + + void onDisconnected(); + + void close(); + + String target(); + + AlphaResponse participate(ParticipatedEvent participateEvent); + + AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent); + + AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent); + + AlphaResponse send(TxEvent event); + } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java index 02adac2..e64bc2a 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java @@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc; import java.lang.invoke.MethodHandles; import java.lang.reflect.Method; +import org.apache.servicecomb.saga.common.TransactionStatus; import org.apache.servicecomb.saga.omega.context.OmegaContext; import org.apache.servicecomb.saga.omega.transaction.MessageSender; import org.apache.servicecomb.saga.omega.transaction.OmegaException; @@ -27,6 +28,7 @@ import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy; import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory; import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable; import org.apache.servicecomb.saga.omega.transaction.annotations.Participate; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -39,9 +41,11 @@ public class TccParticipatorAspect { private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final OmegaContext context; + private final TccEventService tccEventService; - public TccParticipatorAspect(MessageSender sender, OmegaContext context) { + public TccParticipatorAspect(TccEventService tccEventService, OmegaContext context) { this.context = context; +this.tccEventService = tccEventService; } @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate * *(..)) && @annotation(participate)") @@ -49,6 +53,7 @@ public class TccParticipatorAspect { Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); String localTxId = context.localTxId(); String cancelMethod = participate.cancelMethod(); +String confirmMethod = participate.confirmMethod(); context.newLocalTxId(); LOG.debug("Updated context {} for participate method {} ", context, method.toString()); @@ -56,13 +61,18 @@ public class TccParticipatorAspect { try { Object result = joinPoint.proceed(); // Send the participate message back + tccEventService.participate(new
[incubator-servicecomb-saga] branch SCB-665 updated (6a70e60 -> 7718071)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git. discard 6a70e60 SCB-818 Omega supports of TCC (WIP) discard 0f167b0 SCB-817 Updated the TCC grpc contract file discard 4bdb8dc SCB-817 Updated the grpc file of TccEventService discard d4a9731 SCB-817 Added the License headers discard cfdd2c9 SCB-817 Updated the pack-contracts protocal for TCC discard 7620c1e SCB-817 Added TCC events in Omega part (WIP) discard a9d52d6 SCB-817 Added TCC events in Omega part (WIP) add db95f8b SCB-855 Support JDK7 in saga-format add d300e17 SCB-855 Support JDK7 in saga-format test add 00a6f40 SCB-855 change maven-compiler supported jdk7 add d64f3fc SCB-855 extract an empty map constant add 84194af SCB-855 fix computeIfAbsent rewrite infinite loop error add 0e3593e [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and MessageDeserializer property. - Refactoring the constructor of LoadBalancedClusterMessageSender. - Modifying respective test cases and references. - Killing some issue detected by SonarLint. new 95ad81f SCB-817 Added TCC events in Omega part (WIP) new 35d946c SCB-817 Added TCC events in Omega part (WIP) new 09cb574 SCB-817 Updated the pack-contracts protocal for TCC new 8c0a63c SCB-817 Added the License headers new b70984a SCB-817 Updated the grpc file of TccEventService new eae940b SCB-817 Updated the TCC grpc contract file new 7718071 SCB-818 Omega supports of TCC (WIP) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (6a70e60) \ N -- N -- N refs/heads/SCB-665 (7718071) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 7 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../omega/connector/grpc/AlphaClusterConfig.java | 122 - .../grpc/LoadBalancedClusterMessageSender.java | 22 ++-- ...LoadBalanceClusterMessageSenderWithTLSTest.java | 38 --- .../grpc/LoadBalancedClusterMessageSenderTest.java | 40 ++- .../saga/omega/spring/OmegaSpringConfig.java | 22 ++-- saga-format/pom.xml| 18 ++- .../servicecomb/saga/format/ChildrenExtractor.java | 8 +- .../saga/format/JacksonRestOperation.java | 6 +- .../saga/format/JacksonSagaEventFormat.java| 47 ++-- .../saga/format/JsonSagaDefinition.java| 5 +- .../saga/format/JacksonFromJsonFormatTest.java | 82 ++ .../saga/format/JacksonRestOperationTest.java | 11 +- .../saga/format/JsonRestSagaRequestTest.java | 8 +- .../saga/format/SagaEventFormatTest.java | 10 +- 14 files changed, 324 insertions(+), 115 deletions(-)
[incubator-servicecomb-saga] 05/07: SCB-817 Updated the grpc file of TccEventService
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit b70984aba1ac8172cb4df387bed44eb0a8e264b0 Author: Willem Jiang AuthorDate: Mon Aug 20 19:10:07 2018 +0800 SCB-817 Updated the grpc file of TccEventService --- .../src/main/proto/GrpcTccEvent.proto | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto index 1eba5e5..9e1752f 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto"; import "GrpcCommon.proto"; service TccEventService { - rpc participate(GrpcParticipateEvent) returns (GrpcAck) {} - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) { + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { } - rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {} - rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {} + rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {} + rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} + rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { } } -message GrpcTransactionStartedEvent { +message GrpcTccTransactionStartedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; } -message GrpcParticipateEvent { +message GrpcTccParticipateEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; @@ -49,7 +49,7 @@ message GrpcParticipateEvent { string cancelMethod = 7; } -message GrpcTransactionEndedEvent { +message GrpcTccTransactionEndedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; @@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent { string type = 5; } -message GrpcCordinateCommand { +message GrpcTccCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string type = 4; + string method = 4; }
[incubator-servicecomb-saga] 06/07: SCB-817 Updated the TCC grpc contract file
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit eae940b99500d31d7ee4780b11c920883ef6e508 Author: Willem Jiang AuthorDate: Tue Aug 21 09:59:02 2018 +0800 SCB-817 Updated the TCC grpc contract file --- .../omega/transaction/tcc/TccEventService.java | 4 .../{TccStartEvent.java => ParticipatedEvent.java} | 22 +- .../{TccEndEvent.java => TccEndedEvent.java} | 9 ++--- .../{TccStartEvent.java => TccStartedEvent.java} | 9 +++-- .../servicecomb/saga/common/TransactionStatus.java | 6 -- .../src/main/proto/GrpcTccEvent.proto | 3 ++- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java new file mode 100644 index 000..1649620 --- /dev/null +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java @@ -0,0 +1,4 @@ +package org.apache.servicecomb.saga.omega.transaction.tcc; + +public class TccService { +} diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java similarity index 77% copy from omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java copy to omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java index 416c182..73ede9c 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java @@ -16,26 +16,22 @@ */ package org.apache.servicecomb.saga.omega.transaction.tcc.events; -public class TccStartEvent { + +public class ParticipateEvent { + private final String globalTxId; private final String localTxId; private final String parentTxId; + private final String confirmMethod; + private final String cancelMethod; - public String getGlobalTxId() { -return globalTxId; - } - - public String getLocalTxId() { -return localTxId; - } - - public String getParentTxId() { -return parentTxId; - } - public TccStartEvent(String globalTxId, String localTxId, String parentTxId) { + public ParticipateEvent(String globalTxId, String localTxId, String parentTxId, String confirmMethod, + String cancelMethod) { this.globalTxId = globalTxId; this.localTxId = localTxId; this.parentTxId = parentTxId; +this.confirmMethod = confirmMethod; +this.cancelMethod = cancelMethod; } } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java similarity index 82% rename from omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java rename to omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java index 541489f..9107ab0 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java @@ -16,15 +16,18 @@ */ package org.apache.servicecomb.saga.omega.transaction.tcc.events; +import org.apache.servicecomb.saga.common.TransactionStatus; + public class TccEndEvent { private final String globalTxId; private final String localTxId; - private final String parentTxId; + private final TransactionStatus status; - public TccEndEvent(String globalTxId, String localTxId, String parentTxId) { + public TccEndEvent(String globalTxId, String localTxId, + TransactionStatus status) { this.globalTxId = globalTxId; this.localTxId = localTxId; -this.parentTxId = parentTxId; +this.status = status; } } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartedEvent.java similarity index 84% rename from omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java rename to
[incubator-servicecomb-saga] 02/07: SCB-817 Added TCC events in Omega part (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 35d946c7f94680aa6d8a257dc2b9165353737413 Author: Willem Jiang AuthorDate: Thu Aug 16 10:44:06 2018 +0800 SCB-817 Added TCC events in Omega part (WIP) --- .../saga/omega/context/annotations/TccStart.java | 7 +++ .../annotations/{TCC.java => Participate.java} | 14 ++--- .../saga/omega/transaction/tcc/TccAspect.java | 48 --- .../saga/omega/transaction/tcc/TccInterceptor.java | 4 -- .../transaction/tcc/TccParticipatorAspect.java | 68 ++ .../tcc/TccStartAnnotationProcessor.java | 6 +- .../saga/omega/transaction/tcc/TccStartAspect.java | 7 ++- .../omega/transaction/tcc/events/CancelEvent.java | 20 --- .../omega/transaction/tcc/events/ConfirmEvent.java | 20 --- .../omega/transaction/tcc/events/TccEndEvent.java | 14 + .../transaction/tcc/events/TccStartEvent.java | 25 .../tcc/events/TransactionEndEvent.java| 4 -- .../tcc/events/TransationStartEvent.java | 4 -- 13 files changed, 129 insertions(+), 112 deletions(-) diff --git a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java index c9154f9..6c8afd2 100644 --- a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java +++ b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java @@ -12,4 +12,11 @@ import java.lang.annotation.Target; @Retention(RUNTIME) @Target(METHOD) public @interface TccStart { + /** + * TCC timeout, in seconds. + * Default value is 0, which means never timeout. + * + * @return + */ + int timeout() default 0; } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java similarity index 79% rename from omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java rename to omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java index a095978..8351076 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java @@ -25,22 +25,22 @@ import java.lang.annotation.Target; @Target({ElementType.METHOD}) /** * Indicates the annotated method will start a sub-transaction. - * A @TCC method should satisfy below requirements: + * A @Participate method should satisfy below requirements: * * all parameters are serialized * is idempotent - * the object instance which @TCC method resides in should be stateless + * the object instance which @Participate method resides in should be stateless * */ -public @interface TCC { +public @interface Participate { /** * Confirm method name. * A confirm method should satisfy below requirements: * - * has same parameter list as @TCC method's + * has same parameter list as @Participate method's * all parameters are serialized * is idempotent - * be in the same class as @TCC method is in + * be in the same class as @Participate method is in * * * @return @@ -51,10 +51,10 @@ public @interface TCC { * Cancel method name. * A cancel method should satisfy below requirements: * - * has same parameter list as @TCC method's + * has same parameter list as @Participate method's * all parameters are serialized * is idempotent - * be in the same class as @TCC method is in + * be in the same class as @Participate method is in * * * @return diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java deleted file mode 100644 index 173cb78..000 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.apache.servicecomb.saga.omega.transaction.tcc; - -import java.lang.invoke.MethodHandles; -import java.lang.reflect.Method; - -import org.apache.servicecomb.saga.omega.context.OmegaContext; -import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor; -import org.apache.servicecomb.saga.omega.transaction.MessageSender; -import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy; -import
[incubator-servicecomb-saga] 01/07: SCB-817 Added TCC events in Omega part (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit a9d52d6e4e824f349ae7b9e7fe46441c49be2c0f Author: Willem Jiang AuthorDate: Sun Aug 12 11:16:22 2018 +0800 SCB-817 Added TCC events in Omega part (WIP) --- .../saga/omega/context/annotations/TccStart.java | 15 + .../saga/omega/transaction/annotations/TCC.java| 64 ++ .../saga/omega/transaction/tcc/TccAspect.java | 48 .../saga/omega/transaction/tcc/TccInterceptor.java | 4 ++ .../tcc/TccStartAnnotationProcessor.java | 47 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 .../omega/transaction/tcc/events/CancelEvent.java | 20 +++ .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++ .../transaction/tcc/events/ParticipateEvent.java | 21 +++ .../tcc/events/TransactionEndEvent.java| 4 ++ .../tcc/events/TransationStartEvent.java | 4 ++ 11 files changed, 307 insertions(+) diff --git a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java new file mode 100644 index 000..c9154f9 --- /dev/null +++ b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java @@ -0,0 +1,15 @@ +package org.apache.servicecomb.saga.omega.context.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Indicates the annotated method will start a TCC . + */ +@Retention(RUNTIME) +@Target(METHOD) +public @interface TccStart { +} diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java new file mode 100644 index 000..a095978 --- /dev/null +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +package org.apache.servicecomb.saga.omega.transaction.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +/** + * Indicates the annotated method will start a sub-transaction. + * A @TCC method should satisfy below requirements: + * + * all parameters are serialized + * is idempotent + * the object instance which @TCC method resides in should be stateless + * + */ +public @interface TCC { + /** + * Confirm method name. + * A confirm method should satisfy below requirements: + * + * has same parameter list as @TCC method's + * all parameters are serialized + * is idempotent + * be in the same class as @TCC method is in + * + * + * @return + */ + String confirmMethod() default ""; + + /** + * Cancel method name. + * A cancel method should satisfy below requirements: + * + * has same parameter list as @TCC method's + * all parameters are serialized + * is idempotent + * be in the same class as @TCC method is in + * + * + * @return + */ + String cancelMethod() default ""; + +} diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java new file mode 100644 index 000..173cb78 --- /dev/null +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java @@ -0,0 +1,48 @@ +package org.apache.servicecomb.saga.omega.transaction.tcc; + +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Method; +
[incubator-servicecomb-saga] 05/07: SCB-817 Updated the grpc file of TccEventService
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 4bdb8dc1a98ebbee16b1200b13ed24dd7ecc7e39 Author: Willem Jiang AuthorDate: Mon Aug 20 19:10:07 2018 +0800 SCB-817 Updated the grpc file of TccEventService --- .../src/main/proto/GrpcTccEvent.proto | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto index 1eba5e5..9e1752f 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto"; import "GrpcCommon.proto"; service TccEventService { - rpc participate(GrpcParticipateEvent) returns (GrpcAck) {} - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) { + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { } - rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {} - rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {} + rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {} + rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} + rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { } } -message GrpcTransactionStartedEvent { +message GrpcTccTransactionStartedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; } -message GrpcParticipateEvent { +message GrpcTccParticipateEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; @@ -49,7 +49,7 @@ message GrpcParticipateEvent { string cancelMethod = 7; } -message GrpcTransactionEndedEvent { +message GrpcTccTransactionEndedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; @@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent { string type = 5; } -message GrpcCordinateCommand { +message GrpcTccCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string type = 4; + string method = 4; }
[incubator-servicecomb-saga] 01/07: SCB-817 Added TCC events in Omega part (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 95ad81f6eef681b0773aabf0f5588d114a658d4d Author: Willem Jiang AuthorDate: Sun Aug 12 11:16:22 2018 +0800 SCB-817 Added TCC events in Omega part (WIP) --- .../saga/omega/context/annotations/TccStart.java | 15 + .../saga/omega/transaction/annotations/TCC.java| 64 ++ .../saga/omega/transaction/tcc/TccAspect.java | 48 .../saga/omega/transaction/tcc/TccInterceptor.java | 4 ++ .../tcc/TccStartAnnotationProcessor.java | 47 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 .../omega/transaction/tcc/events/CancelEvent.java | 20 +++ .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++ .../transaction/tcc/events/ParticipateEvent.java | 21 +++ .../tcc/events/TransactionEndEvent.java| 4 ++ .../tcc/events/TransationStartEvent.java | 4 ++ 11 files changed, 307 insertions(+) diff --git a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java new file mode 100644 index 000..c9154f9 --- /dev/null +++ b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java @@ -0,0 +1,15 @@ +package org.apache.servicecomb.saga.omega.context.annotations; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Indicates the annotated method will start a TCC . + */ +@Retention(RUNTIME) +@Target(METHOD) +public @interface TccStart { +} diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java new file mode 100644 index 000..a095978 --- /dev/null +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java @@ -0,0 +1,64 @@ +/* + * 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. + */ +package org.apache.servicecomb.saga.omega.transaction.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD}) +/** + * Indicates the annotated method will start a sub-transaction. + * A @TCC method should satisfy below requirements: + * + * all parameters are serialized + * is idempotent + * the object instance which @TCC method resides in should be stateless + * + */ +public @interface TCC { + /** + * Confirm method name. + * A confirm method should satisfy below requirements: + * + * has same parameter list as @TCC method's + * all parameters are serialized + * is idempotent + * be in the same class as @TCC method is in + * + * + * @return + */ + String confirmMethod() default ""; + + /** + * Cancel method name. + * A cancel method should satisfy below requirements: + * + * has same parameter list as @TCC method's + * all parameters are serialized + * is idempotent + * be in the same class as @TCC method is in + * + * + * @return + */ + String cancelMethod() default ""; + +} diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java new file mode 100644 index 000..173cb78 --- /dev/null +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java @@ -0,0 +1,48 @@ +package org.apache.servicecomb.saga.omega.transaction.tcc; + +import java.lang.invoke.MethodHandles; +import java.lang.reflect.Method; +
[incubator-servicecomb-saga] 03/07: SCB-817 Updated the pack-contracts protocal for TCC
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit cfdd2c919c8194de8c0550fe6a9fdaa2765026aa Author: Willem Jiang AuthorDate: Thu Aug 16 10:52:19 2018 +0800 SCB-817 Updated the pack-contracts protocal for TCC --- .../proto/{GrpcTxEvent.proto => GrpcCommon.proto} | 33 + .../{GrpcTxEvent.proto => GrpcTccEvent.proto} | 43 -- .../src/main/proto/GrpcTxEvent.proto | 11 +- 3 files changed, 26 insertions(+), 61 deletions(-) diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto similarity index 58% copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto index d2c6f77..40a8db7 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto @@ -19,15 +19,8 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.servicecomb.saga.pack.contract.grpc"; -option java_outer_classname = "TxEventProto"; -service TxEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) { - } - rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {} - rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { - } -} +// Define the common structs which could be use for TccEventService and SagaEventService message GrpcServiceConfig { string serviceName = 1; @@ -37,27 +30,3 @@ message GrpcServiceConfig { message GrpcAck { bool aborted = 1; } - -message GrpcTxEvent { - int64 timestamp = 1; - string globalTxId = 2; - string localTxId = 3; - string parentTxId = 4; - string type = 5; - string compensationMethod = 6; - bytes payloads = 7; - string serviceName = 8; - string instanceId = 9; - int32 timeout = 10; - int32 retries = 11; - string retryMethod = 12; -} - -message GrpcCompensateCommand { - string globalTxId = 1; - string localTxId = 2; - string parentTxId = 3; - string compensationMethod = 4; - bytes payloads = 5; -} - diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto similarity index 60% copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto index d2c6f77..1eba5e5 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -19,45 +19,48 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.servicecomb.saga.pack.contract.grpc"; -option java_outer_classname = "TxEventProto"; +option java_outer_classname = "TccEventProto"; -service TxEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) { +import "GrpcCommon.proto"; + +service TccEventService { + rpc participate(GrpcParticipateEvent) returns (GrpcAck) {} + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) { } - rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {} + rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {} + rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { } } -message GrpcServiceConfig { - string serviceName = 1; - string instanceId = 2; +message GrpcTransactionStartedEvent { + int64 timestamp = 1; + string globalTxId = 2; + string localTxId = 3; + string parentTxId = 4; } -message GrpcAck { - bool aborted = 1; +message GrpcParticipateEvent { + int64 timestamp = 1; + string globalTxId = 2; + string localTxId = 3; + string parentTxId = 4; + string confirmMethod = 6; + string cancelMethod = 7; } -message GrpcTxEvent { +message GrpcTransactionEndedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; string type = 5; - string compensationMethod = 6; - bytes payloads = 7; - string serviceName = 8; - string instanceId = 9; - int32 timeout = 10; - int32 retries = 11; - string retryMethod = 12; } -message GrpcCompensateCommand { +message GrpcCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string compensationMethod = 4; - bytes payloads = 5; + string type = 4; } diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto index d2c6f77..f037b4f 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++
[incubator-servicecomb-saga] 04/07: SCB-817 Added the License headers
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 8c0a63c56a57e9430ab7b9991781aadfeb86a24d Author: Willem Jiang AuthorDate: Mon Aug 20 19:06:20 2018 +0800 SCB-817 Added the License headers --- .../transaction/tcc/TccStartAnnotationProcessor.java | 16 .../saga/omega/transaction/tcc/TccStartAspect.java | 16 .../saga/omega/transaction/tcc/events/TccEndEvent.java | 16 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 4 files changed, 64 insertions(+) diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java index b38d876..b93373f 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package org.apache.servicecomb.saga.omega.transaction.tcc; import javax.transaction.TransactionalException; diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java index c8b7936..90728e3 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package org.apache.servicecomb.saga.omega.transaction.tcc; import java.lang.invoke.MethodHandles; diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java index 1022aee..541489f 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package
[incubator-servicecomb-saga] 07/07: SCB-818 Omega supports of TCC (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 7718071b991f13b5ca293c7e7543ac2b9102a2a4 Author: Willem Jiang AuthorDate: Tue Aug 21 10:25:13 2018 +0800 SCB-818 Omega supports of TCC (WIP) --- .../omega/transaction/tcc/TccEventService.java | 25 - .../transaction/tcc/TccParticipatorAspect.java | 14 ++-- .../tcc/TccStartAnnotationProcessor.java | 26 ++ .../saga/omega/transaction/tcc/TccStartAspect.java | 4 ++-- .../transaction/tcc/events/ParticipatedEvent.java | 10 ++--- .../transaction/tcc/events/TccEndedEvent.java | 4 ++-- .../transaction/tcc/events/TccStartedEvent.java| 4 ++-- 7 files changed, 61 insertions(+), 26 deletions(-) diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java index 1649620..ae011bc 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java @@ -1,4 +1,27 @@ package org.apache.servicecomb.saga.omega.transaction.tcc; -public class TccService { +import org.apache.servicecomb.saga.omega.transaction.AlphaResponse; +import org.apache.servicecomb.saga.omega.transaction.TxEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent; + +public interface TccEventService { + + void onConnected(); + + void onDisconnected(); + + void close(); + + String target(); + + AlphaResponse participate(ParticipatedEvent participateEvent); + + AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent); + + AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent); + + AlphaResponse send(TxEvent event); + } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java index 02adac2..e64bc2a 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java @@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc; import java.lang.invoke.MethodHandles; import java.lang.reflect.Method; +import org.apache.servicecomb.saga.common.TransactionStatus; import org.apache.servicecomb.saga.omega.context.OmegaContext; import org.apache.servicecomb.saga.omega.transaction.MessageSender; import org.apache.servicecomb.saga.omega.transaction.OmegaException; @@ -27,6 +28,7 @@ import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy; import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory; import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable; import org.apache.servicecomb.saga.omega.transaction.annotations.Participate; +import org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -39,9 +41,11 @@ public class TccParticipatorAspect { private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private final OmegaContext context; + private final TccEventService tccEventService; - public TccParticipatorAspect(MessageSender sender, OmegaContext context) { + public TccParticipatorAspect(TccEventService tccEventService, OmegaContext context) { this.context = context; +this.tccEventService = tccEventService; } @Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate * *(..)) && @annotation(participate)") @@ -49,6 +53,7 @@ public class TccParticipatorAspect { Method method = ((MethodSignature) joinPoint.getSignature()).getMethod(); String localTxId = context.localTxId(); String cancelMethod = participate.cancelMethod(); +String confirmMethod = participate.confirmMethod(); context.newLocalTxId(); LOG.debug("Updated context {} for participate method {} ", context, method.toString()); @@ -56,13 +61,18 @@ public class TccParticipatorAspect { try { Object result = joinPoint.proceed(); // Send the participate message back + tccEventService.participate(new
[incubator-servicecomb-saga] 03/07: SCB-817 Updated the pack-contracts protocal for TCC
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 09cb5743484de5ba802177b0bf487c6651ceea47 Author: Willem Jiang AuthorDate: Thu Aug 16 10:52:19 2018 +0800 SCB-817 Updated the pack-contracts protocal for TCC --- .../proto/{GrpcTxEvent.proto => GrpcCommon.proto} | 33 + .../{GrpcTxEvent.proto => GrpcTccEvent.proto} | 43 -- .../src/main/proto/GrpcTxEvent.proto | 11 +- 3 files changed, 26 insertions(+), 61 deletions(-) diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto similarity index 58% copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto index d2c6f77..40a8db7 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto @@ -19,15 +19,8 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.servicecomb.saga.pack.contract.grpc"; -option java_outer_classname = "TxEventProto"; -service TxEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) { - } - rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {} - rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { - } -} +// Define the common structs which could be use for TccEventService and SagaEventService message GrpcServiceConfig { string serviceName = 1; @@ -37,27 +30,3 @@ message GrpcServiceConfig { message GrpcAck { bool aborted = 1; } - -message GrpcTxEvent { - int64 timestamp = 1; - string globalTxId = 2; - string localTxId = 3; - string parentTxId = 4; - string type = 5; - string compensationMethod = 6; - bytes payloads = 7; - string serviceName = 8; - string instanceId = 9; - int32 timeout = 10; - int32 retries = 11; - string retryMethod = 12; -} - -message GrpcCompensateCommand { - string globalTxId = 1; - string localTxId = 2; - string parentTxId = 3; - string compensationMethod = 4; - bytes payloads = 5; -} - diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto similarity index 60% copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto index d2c6f77..1eba5e5 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -19,45 +19,48 @@ syntax = "proto3"; option java_multiple_files = true; option java_package = "org.apache.servicecomb.saga.pack.contract.grpc"; -option java_outer_classname = "TxEventProto"; +option java_outer_classname = "TccEventProto"; -service TxEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) { +import "GrpcCommon.proto"; + +service TccEventService { + rpc participate(GrpcParticipateEvent) returns (GrpcAck) {} + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) { } - rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {} + rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {} + rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { } } -message GrpcServiceConfig { - string serviceName = 1; - string instanceId = 2; +message GrpcTransactionStartedEvent { + int64 timestamp = 1; + string globalTxId = 2; + string localTxId = 3; + string parentTxId = 4; } -message GrpcAck { - bool aborted = 1; +message GrpcParticipateEvent { + int64 timestamp = 1; + string globalTxId = 2; + string localTxId = 3; + string parentTxId = 4; + string confirmMethod = 6; + string cancelMethod = 7; } -message GrpcTxEvent { +message GrpcTransactionEndedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; string type = 5; - string compensationMethod = 6; - bytes payloads = 7; - string serviceName = 8; - string instanceId = 9; - int32 timeout = 10; - int32 retries = 11; - string retryMethod = 12; } -message GrpcCompensateCommand { +message GrpcCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string compensationMethod = 4; - bytes payloads = 5; + string type = 4; } diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto index d2c6f77..f037b4f 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto +++
[incubator-servicecomb-saga] 02/07: SCB-817 Added TCC events in Omega part (WIP)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 7620c1e3300b1e9c4efa83683627657b85a7ea27 Author: Willem Jiang AuthorDate: Thu Aug 16 10:44:06 2018 +0800 SCB-817 Added TCC events in Omega part (WIP) --- .../saga/omega/context/annotations/TccStart.java | 7 +++ .../annotations/{TCC.java => Participate.java} | 14 ++--- .../saga/omega/transaction/tcc/TccAspect.java | 48 --- .../saga/omega/transaction/tcc/TccInterceptor.java | 4 -- .../transaction/tcc/TccParticipatorAspect.java | 68 ++ .../tcc/TccStartAnnotationProcessor.java | 6 +- .../saga/omega/transaction/tcc/TccStartAspect.java | 7 ++- .../omega/transaction/tcc/events/CancelEvent.java | 20 --- .../omega/transaction/tcc/events/ConfirmEvent.java | 20 --- .../omega/transaction/tcc/events/TccEndEvent.java | 14 + .../transaction/tcc/events/TccStartEvent.java | 25 .../tcc/events/TransactionEndEvent.java| 4 -- .../tcc/events/TransationStartEvent.java | 4 -- 13 files changed, 129 insertions(+), 112 deletions(-) diff --git a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java index c9154f9..6c8afd2 100644 --- a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java +++ b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java @@ -12,4 +12,11 @@ import java.lang.annotation.Target; @Retention(RUNTIME) @Target(METHOD) public @interface TccStart { + /** + * TCC timeout, in seconds. + * Default value is 0, which means never timeout. + * + * @return + */ + int timeout() default 0; } diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java similarity index 79% rename from omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java rename to omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java index a095978..8351076 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java @@ -25,22 +25,22 @@ import java.lang.annotation.Target; @Target({ElementType.METHOD}) /** * Indicates the annotated method will start a sub-transaction. - * A @TCC method should satisfy below requirements: + * A @Participate method should satisfy below requirements: * * all parameters are serialized * is idempotent - * the object instance which @TCC method resides in should be stateless + * the object instance which @Participate method resides in should be stateless * */ -public @interface TCC { +public @interface Participate { /** * Confirm method name. * A confirm method should satisfy below requirements: * - * has same parameter list as @TCC method's + * has same parameter list as @Participate method's * all parameters are serialized * is idempotent - * be in the same class as @TCC method is in + * be in the same class as @Participate method is in * * * @return @@ -51,10 +51,10 @@ public @interface TCC { * Cancel method name. * A cancel method should satisfy below requirements: * - * has same parameter list as @TCC method's + * has same parameter list as @Participate method's * all parameters are serialized * is idempotent - * be in the same class as @TCC method is in + * be in the same class as @Participate method is in * * * @return diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java deleted file mode 100644 index 173cb78..000 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.apache.servicecomb.saga.omega.transaction.tcc; - -import java.lang.invoke.MethodHandles; -import java.lang.reflect.Method; - -import org.apache.servicecomb.saga.omega.context.OmegaContext; -import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor; -import org.apache.servicecomb.saga.omega.transaction.MessageSender; -import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy; -import
[incubator-servicecomb-saga] 04/07: SCB-817 Added the License headers
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit d4a9731d9f4b832d6ea8d02c3323102e588445ea Author: Willem Jiang AuthorDate: Mon Aug 20 19:06:20 2018 +0800 SCB-817 Added the License headers --- .../transaction/tcc/TccStartAnnotationProcessor.java | 16 .../saga/omega/transaction/tcc/TccStartAspect.java | 16 .../saga/omega/transaction/tcc/events/TccEndEvent.java | 16 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 4 files changed, 64 insertions(+) diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java index b38d876..b93373f 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package org.apache.servicecomb.saga.omega.transaction.tcc; import javax.transaction.TransactionalException; diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java index c8b7936..90728e3 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package org.apache.servicecomb.saga.omega.transaction.tcc; import java.lang.invoke.MethodHandles; diff --git a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java index 1022aee..541489f 100644 --- a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java +++ b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java @@ -1,3 +1,19 @@ +/* + * 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. + */ package
[incubator-servicecomb-saga] branch SCB-665 updated (718893b -> 6a70e60)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch SCB-665 in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git. omit 718893b SCB-818 Omega supports of TCC (WIP) omit 11fdb91 SCB-817 Updated the TCC grpc contract file omit 4efa3a9 SCB-817 Updated the grpc file of TccEventService omit 29bfbde SCB-817 Added the License header omit 277ff27 SCB-817 Updated the pack-contracts protocal for TCC omit 0c16634 SCB-817 Added TCC events in Omega part (WIP) omit 5b1ea96 SCB-817 Added TCC events in Omega part (WIP) add 67f9b95 Updated Readme file for the new added Omega plugins add 13e5646 Fix the formate issue README new a9d52d6 SCB-817 Added TCC events in Omega part (WIP) new 7620c1e SCB-817 Added TCC events in Omega part (WIP) new cfdd2c9 SCB-817 Updated the pack-contracts protocal for TCC new d4a9731 SCB-817 Added the License headers new 4bdb8dc SCB-817 Updated the grpc file of TccEventService new 0f167b0 SCB-817 Updated the TCC grpc contract file new 6a70e60 SCB-818 Omega supports of TCC (WIP) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (718893b) \ N -- N -- N refs/heads/SCB-665 (6a70e60) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 7 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: README.md| 7 +-- README_ZH.md | 8 ++-- 2 files changed, 11 insertions(+), 4 deletions(-)
[GitHub] cherrylzhao opened a new pull request #262: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao opened a new pull request #262: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/262 Implement reaction of TCC event in alpha server, which involves - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) - rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) - rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) - rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on issue #260: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on issue #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260#issuecomment-414701166 As the branch of SCB-665 is updated, please use rebase after fetch the change from the branch. BTW, we need to update the UT to make the sure the code is work out of box. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260#discussion_r211627693 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/event/ParticipateEvent.java ## @@ -0,0 +1,115 @@ +/* + * + * * 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. + * + */ + +package org.apache.servicecomb.saga.alpha.tcc.server.event; + +import org.apache.servicecomb.saga.common.TransactionStatus; + +/** + * Participate event. + * + * @author zhaojun + */ +public class ParticipateEvent { Review comment: There is participatedEvent in the event package, we need to merge it. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260#discussion_r211621657 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java ## @@ -0,0 +1,74 @@ +/* + * + * * 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. + * + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEventFactory; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipateEvent; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionStartedEvent; +import org.apache.servicecomb.saga.pack.contract.grpc.TccEventServiceGrpc; + +/** + * Grpc TCC event service implement. + * + * @author zhaojun + */ +public class GrpcTccEventService extends TccEventServiceGrpc.TccEventServiceImplBase { + + private static final GrpcAck ALLOW = GrpcAck.newBuilder().setAborted(false).build(); + private static final GrpcAck REJECT = GrpcAck.newBuilder().setAborted(true).build(); + + @Override + public void onConnected(GrpcServiceConfig request, StreamObserver responseObserver) { +OmegaCallbacksRegistry.register(request, responseObserver); + } + + @Override + public void onTccTransactionStarted(GrpcTccTransactionStartedEvent request, StreamObserver responseObserver) { + } + + @Override + public void participate(GrpcTccParticipateEvent request, StreamObserver responseObserver) { +TransactionEventRegistry.register(ParticipateEventFactory.create(request)); +responseObserver.onNext(ALLOW); +responseObserver.onCompleted(); Review comment: onCompleted could close the stream, I don't think we need to do that here. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260#discussion_r211620371 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java ## @@ -0,0 +1,50 @@ +/* + * + * * 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. + * + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun Review comment: We normally don't use the author name in Apache as we can use git to look it up. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] cherrylzhao closed pull request #260: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao closed pull request #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml index c4916eea..75145e5b 100644 --- a/alpha/alpha-server/pom.xml +++ b/alpha/alpha-server/pom.xml @@ -200,7 +200,7 @@ -spring-boot-2 + spring-boot-2 ${spring.boot2.version} diff --git a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java new file mode 100644 index ..e27d1a36 --- /dev/null +++ b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcOmegaTccCallback.java @@ -0,0 +1,50 @@ +/* + * + * * 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. + * + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun + */ +public final class GrpcOmegaTccCallback implements OmegaCallback { + + private StreamObserver responseObserver; + + public GrpcOmegaTccCallback(StreamObserver responseObserver) { +this.responseObserver = responseObserver; + } + + @Override + public void compensate(ParticipateEvent event, TransactionStatus status) { +GrpcTccCordinateCommand command = GrpcTccCordinateCommand.newBuilder() +.setGlobalTxId(event.getGlobalTxId()) +.setLocalTxId(event.getLocalTxId()) +.setParentTxId(event.getParentTxId() == null ? "" : event.getParentTxId()) +.setMethod(TransactionStatus.Succeed.equals(status) ? event.getConfirmMethod() : event.getCancelMethod()) +.build(); +responseObserver.onNext(command); + } +} diff --git a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java new file mode 100644 index ..90e2df06 --- /dev/null +++ b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/GrpcTccEventService.java @@ -0,0 +1,74 @@ +/* + * + * * 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. + * + */ + +package org.apache.servicecomb.saga.alpha.tcc.server; + +import io.grpc.stub.StreamObserver; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEvent; +import org.apache.servicecomb.saga.alpha.tcc.server.event.ParticipateEventFactory; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCordinateCommand; +import
[incubator-servicecomb-saga] branch master updated: [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and MessageDese
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git The following commit(s) were added to refs/heads/master by this push: new 0e3593e [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and MessageDeserializer property. - Refactoring the constructor of LoadBalancedClusterMessageSender. - Modifying respective test cases and references. - Killing some issue detected by SonarLint. 0e3593e is described below commit 0e3593eecbea677bd0a732ef57c64b4df754f7c5 Author: imlijinting <41796346+imlijint...@users.noreply.github.com> AuthorDate: Tue Aug 21 21:35:28 2018 +0800 [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and MessageDeserializer property. - Refactoring the constructor of LoadBalancedClusterMessageSender. - Modifying respective test cases and references. - Killing some issue detected by SonarLint. --- .../omega/connector/grpc/AlphaClusterConfig.java | 122 - .../grpc/LoadBalancedClusterMessageSender.java | 22 ++-- ...LoadBalanceClusterMessageSenderWithTLSTest.java | 38 --- .../grpc/LoadBalancedClusterMessageSenderTest.java | 40 ++- .../saga/omega/spring/OmegaSpringConfig.java | 22 ++-- 5 files changed, 171 insertions(+), 73 deletions(-) diff --git a/omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/AlphaClusterConfig.java b/omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/AlphaClusterConfig.java index c7aa664..a8641b4 100644 --- a/omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/AlphaClusterConfig.java +++ b/omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/AlphaClusterConfig.java @@ -17,9 +17,14 @@ package org.apache.servicecomb.saga.omega.connector.grpc; +import java.util.Collections; import java.util.List; +import org.apache.servicecomb.saga.omega.transaction.MessageDeserializer; +import org.apache.servicecomb.saga.omega.transaction.MessageHandler; +import org.apache.servicecomb.saga.omega.transaction.MessageSerializer; public class AlphaClusterConfig { + private List addresses; private boolean enableSSL; @@ -32,13 +37,23 @@ public class AlphaClusterConfig { private String certChain; + private MessageSerializer messageSerializer; + + private MessageDeserializer messageDeserializer; + + private MessageHandler messageHandler; + + /** + * @deprecated Use {@link Builder} instead. + */ + @Deprecated public AlphaClusterConfig(List addresses, boolean enableSSL, boolean enableMutualAuth, String cert, String key, String certChain) { -this.addresses = addresses; +this.addresses = addresses == null ? Collections.emptyList() : addresses; this.enableMutualAuth = enableMutualAuth; this.enableSSL = enableSSL; this.cert = cert; @@ -46,6 +61,97 @@ public class AlphaClusterConfig { this.certChain = certChain; } + private AlphaClusterConfig(List addresses, boolean enableSSL, boolean enableMutualAuth, + String cert, String key, String certChain, + MessageSerializer messageSerializer, + MessageDeserializer messageDeserializer, + MessageHandler messageHandler) { +this.addresses = addresses; +this.enableSSL = enableSSL; +this.enableMutualAuth = enableMutualAuth; +this.cert = cert; +this.key = key; +this.certChain = certChain; +this.messageSerializer = messageSerializer; +this.messageDeserializer = messageDeserializer; +this.messageHandler = messageHandler; + } + + public static Builder builder() { +return new Builder(); + } + + public static final class Builder { + +private List addresses; +private boolean enableSSL; +private boolean enableMutualAuth; +private String cert; +private String key; +private String certChain; +private MessageSerializer messageSerializer; +private MessageDeserializer messageDeserializer; +private MessageHandler messageHandler; + +public Builder addresses(List addresses) { + this.addresses = addresses; + return this; +} + +public Builder enableSSL(boolean enableSSL) { + this.enableSSL = enableSSL; + return this; +} + +public Builder enableMutualAuth(boolean enableMutualAuth) { + this.enableMutualAuth = enableMutualAuth; + return this; +} + +public Builder cert(String cert) { + this.cert = cert; + return this; +} + +public Builder key(String key) { + this.key = key; + return this; +} + +public
[GitHub] coveralls commented on issue #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails
coveralls commented on issue #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/880#issuecomment-414690325 [![Coverage Status](https://coveralls.io/builds/18590099/badge)](https://coveralls.io/builds/18590099) Coverage increased (+0.02%) to 86.202% when pulling **e5d74aa8a190772b2bb7af86c896eb5981e7bad5 on yhs0092:abort_registry_when_query_microservice_id_fails** into **3c7f128c9e50239398847126e7857a8db98d85b4 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] imlijinting opened a new pull request #261: [SCB-745] Applying Builder Pattern on AlphaClusterConfig.
imlijinting opened a new pull request #261: [SCB-745] Applying Builder Pattern on AlphaClusterConfig. URL: https://github.com/apache/incubator-servicecomb-saga/pull/261 - Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and MessageDeserializer property. - Refactoring the constructor of LoadBalancedClusterMessageSender. - Modifying respective test cases and references. - Killing some issue detected by SonarLint. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] cherrylzhao opened a new pull request #260: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao opened a new pull request #260: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/260 Implement reaction of TCC event in alpha server, which involve - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) - rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {} - rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {} - rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {} This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] yhs0092 opened a new pull request #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails
yhs0092 opened a new pull request #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/880 Follow this checklist to help us incorporate your contribution quickly and easily: - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [x] Each commit in the pull request should have a meaningful subject line and body. - [x] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- See details in [SCB-860](https://issues.apache.org/jira/browse/SCB-860) This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-saga] branch master updated: SCB-855 fix computeIfAbsent rewrite infinite loop error
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git The following commit(s) were added to refs/heads/master by this push: new 84194af SCB-855 fix computeIfAbsent rewrite infinite loop error 84194af is described below commit 84194afba716203a8d67a7876e446899dd5fcd17 Author: KomachiSion <263976...@qq.com> AuthorDate: Tue Aug 21 18:01:59 2018 +0800 SCB-855 fix computeIfAbsent rewrite infinite loop error --- .../org/apache/servicecomb/saga/format/JacksonRestOperation.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java index 10876fa..c292168 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java @@ -53,10 +53,9 @@ class JacksonRestOperation extends RestOperation implements TransportAware { Map> updated = new HashMap<>(params()); // This is not thread safe if (updated.get("form") == null) { - HashMap formMap = new HashMap<>(); - formMap.put("response", response.body()); - updated.put("form", formMap); + updated.put("form", new HashMap()); } +updated.get("form").put("response", response.body()); return transport.with( address,
[GitHub] WillemJiang closed pull request #259: [SCB-855] fix computeIfAbsent rewrite infinite loop error
WillemJiang closed pull request #259: [SCB-855] fix computeIfAbsent rewrite infinite loop error URL: https://github.com/apache/incubator-servicecomb-saga/pull/259 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java index 10876faa..c2921689 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java @@ -53,10 +53,9 @@ public SagaResponse send(String address, SagaResponse response) { Map> updated = new HashMap<>(params()); // This is not thread safe if (updated.get("form") == null) { - HashMap formMap = new HashMap<>(); - formMap.put("response", response.body()); - updated.put("form", formMap); + updated.put("form", new HashMap()); } +updated.get("form").put("response", response.body()); return transport.with( address, This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] imlidian opened a new pull request #43: Migration build-provider from web repo
imlidian opened a new pull request #43: Migration build-provider from web repo URL: https://github.com/apache/incubator-servicecomb-docs/pull/43 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] imlidian opened a new pull request #42: Migration configuration from web repo
imlidian opened a new pull request #42: Migration configuration from web repo URL: https://github.com/apache/incubator-servicecomb-docs/pull/42 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] KomachiSion opened a new pull request #259: [SCB-855] fix computeIfAbsent rewrite infinite loop error
KomachiSion opened a new pull request #259: [SCB-855] fix computeIfAbsent rewrite infinite loop error URL: https://github.com/apache/incubator-servicecomb-saga/pull/259 fix computeIfAbsent rewrite infinite loop error This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] imlidian closed pull request #41: update content of index page
imlidian closed pull request #41: update content of index page URL: https://github.com/apache/incubator-servicecomb-docs/pull/41 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/saga-reference/LANGS.md b/saga-reference/LANGS.md index 4106f21..b9c8e33 100644 --- a/saga-reference/LANGS.md +++ b/saga-reference/LANGS.md @@ -1,2 +1,2 @@ -* [英文](en_US/) -* [中文](zh_CN/) \ No newline at end of file +* [中文](zh_CN/) +* [English](en_US/) \ No newline at end of file diff --git a/saga-reference/en_US/README.md b/saga-reference/en_US/README.md index 58a2b2b..69e216d 100644 --- a/saga-reference/en_US/README.md +++ b/saga-reference/en_US/README.md @@ -1,5 +1,4 @@ # Saga User Guide -[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md) ## Prerequisites You will need: diff --git a/saga-reference/zh_CN/README.md b/saga-reference/zh_CN/README.md index ba5386e..e70850b 100644 --- a/saga-reference/zh_CN/README.md +++ b/saga-reference/zh_CN/README.md @@ -1,5 +1,4 @@ # Saga 用户指南 -[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](user_guide.md) ## 准备环境 1. 安装[JDK 1.8][jdk] diff --git a/service-center-reference/LANGS.md b/service-center-reference/LANGS.md index 4106f21..b9c8e33 100644 --- a/service-center-reference/LANGS.md +++ b/service-center-reference/LANGS.md @@ -1,2 +1,2 @@ -* [英文](en_US/) -* [中文](zh_CN/) \ No newline at end of file +* [中文](zh_CN/) +* [English](en_US/) \ No newline at end of file diff --git a/service-center-reference/book.json b/service-center-reference/book.json deleted file mode 100644 index 30c4ecc..000 --- a/service-center-reference/book.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "structure": { -"readme": "design.md" - } -} \ No newline at end of file diff --git a/service-center-reference/en_US/README.md b/service-center-reference/en_US/README.md index 1b618b6..98f3527 100644 --- a/service-center-reference/en_US/README.md +++ b/service-center-reference/en_US/README.md @@ -1,9 +1,97 @@ -## Index +# Development Guide -* [Design](design.md) +This chapter is about how to implement the feature of micro-service discovery with ServiceCenter, +and you can get more detail at [here](/server/core/swagger/v3.yaml) -* [Development Guide](dev-guide.md) +## Micro-service registration +```bash +curl -X POST \ + http://127.0.0.1:30100/registry/v3/microservices \ + -H 'content-type: application/json' \ + -H 'x-domain-name: default' \ + -d '{ + "service": + { + "appId": "default", + "serviceName": "DemoService", + "version":"1.0.0" + } +}' +``` -* [Cluster Mode](sc-cluster.md) - -* [Deploy with TLS](security-tls.md) +and then you can get the 'DemoService' ID like below: + +```json +{ +"serviceId": "a3fae679211211e8a831286ed488fc1b" +} +``` + +## Instance registration + +mark down the micro-service ID and call the instance registration API, +according to the ServiceCenter definition: One process should be registered as one instance + +```bash +curl -X POST \ + http://127.0.0.1:30100/registry/v3/microservices/a3fae679211211e8a831286ed488fc1b/instances \ + -H 'content-type: application/json' \ + -H 'x-domain-name: default' \ + -d '{ + "instance": + { + "hostName":"demo-pc", + "endpoints": [ + "rest://127.0.0.1:8080" + ] + } +}' +``` + +the successful response like below: + +```json +{ +"instanceId": "288ad703211311e8a831286ed488fc1b" +} +``` + +if all are successful, it means you have completed the micro-service registration and instance publish + +## Discovery + +the next step is that discovery the micro-service instance by service name and version rule + +```bash +curl -X GET \ + 'http://127.0.0.1:30100/registry/v3/instances?appId=default=DemoService=latest' \ + -H 'content-type: application/json' \ + -H 'x-consumerid: a3fae679211211e8a831286ed488fc1b' \ + -H 'x-domain-name: default' +``` + +here, you can get the information from the response + +```json +{ +"instances": [ +{ +"instanceId": "b4c9e57f211311e8a831286ed488fc1b", +"serviceId": "a3fae679211211e8a831286ed488fc1b", +"version": "1.0.0", +"hostName": "demo-pc", +"endpoints": [ +"rest://127.0.0.1:8080" +], +"status": "UP", +"healthCheck": { +"mode": "push", +"interval": 30, +"times": 3 +}, +"timestamp": "1520322915", +"modTimestamp": "1520322915" +} +] +} +``` \ No newline at end of file diff --git a/service-center-reference/en_US/SUMMARY.md b/service-center-reference/en_US/SUMMARY.md index
[GitHub] imlidian opened a new pull request #41: update content of index page
imlidian opened a new pull request #41: update content of index page URL: https://github.com/apache/incubator-servicecomb-docs/pull/41 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-docs] branch master updated (b64ccd5 -> a376c20)
This is an automated email from the ASF dual-hosted git repository. liubao pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git. from b64ccd5 delete useless file question-and-answer service-center-error-diagnosis.md new dc3e6f0 update java-chassis-reference/en_US/packaging/standalone.md new 750e97b update java-chassis-reference/en_US/packaging/web-container.md new 3e3e43d correct packaging translation mistakes new a376c20 correct web-container.md and standalone.md translate issue The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../en_US/packaging/standalone.md | 24 +++--- .../en_US/packaging/web-container.md | 21 --- .../zh_CN/packaging/standalone.md | 4 ++-- 3 files changed, 23 insertions(+), 26 deletions(-)
[incubator-servicecomb-docs] 04/04: correct web-container.md and standalone.md translate issue
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit a376c205aeb671c88dc708374398c084b807341f Author: DeanLee AuthorDate: Tue Aug 21 16:34:57 2018 +0800 correct web-container.md and standalone.md translate issue --- java-chassis-reference/en_US/packaging/web-container.md | 2 +- java-chassis-reference/zh_CN/packaging/standalone.md| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java-chassis-reference/en_US/packaging/web-container.md b/java-chassis-reference/en_US/packaging/web-container.md index b435acb..bd4e39e 100644 --- a/java-chassis-reference/en_US/packaging/web-container.md +++ b/java-chassis-reference/en_US/packaging/web-container.md @@ -1,6 +1,6 @@ ## Concept Description -If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you just need write few lines of code +If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you just need to write few lines of code ## Development example diff --git a/java-chassis-reference/zh_CN/packaging/standalone.md b/java-chassis-reference/zh_CN/packaging/standalone.md index 9b0dc25..cff8b42 100644 --- a/java-chassis-reference/zh_CN/packaging/standalone.md +++ b/java-chassis-reference/zh_CN/packaging/standalone.md @@ -7,8 +7,8 @@ * **步骤1** 编写Main函数,初始化日志和加载服务配置,内容如下: ```java -import com.huawei.paas.foundation.common.utils.BeanUtils; -import com.huawei.paas.foundation.common.utils.Log4jUtils; +import org.apache.servicecomb.foundation.common.utils.BeanUtils; +import org.apache.servicecomb.foundation.common.utils.Log4jUtils; public class MainServer { public static void main(String[] args) throws Exception { Log4jUtils.init(); # 日志初始化
[incubator-servicecomb-docs] 02/04: update java-chassis-reference/en_US/packaging/web-container.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 750e97b06f056d0a20806a00aac9c5f4d89ad6f6 Author: DeanLee AuthorDate: Mon Aug 20 14:50:19 2018 +0800 update java-chassis-reference/en_US/packaging/web-container.md --- .../en_US/packaging/web-container.md| 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/java-chassis-reference/en_US/packaging/web-container.md b/java-chassis-reference/en_US/packaging/web-container.md index 7b11276..63acefa 100644 --- a/java-chassis-reference/en_US/packaging/web-container.md +++ b/java-chassis-reference/en_US/packaging/web-container.md @@ -1,20 +1,17 @@ -## 概念阐述 +## Concept Description -如果需要将该微服务加载到web容器中启动运行时,需要新建一个servlet工程包装一下,该servlet工程,根据需要,可以不写或写少量的引导代码即可。 +If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you can not write or write a small amount of boot code as needed. -## 开发示例 +## Development example -参考“开发服务提供者” - “通信协议" - "REST over Servlet"章节。 +Refer to the "Development Service Provider" -> "Communication Protocol" -> "REST over Servlet" chapter. -## 注意事项 +## Notes -Restful调用应该与web容器中其他静态资源调用(比如html、js等等)隔离开来,所以webroot后一段应该还有一层关键字,比如上面web.xml中举的例子(/test/rest)中的rest。 - -以tomcat为例,默认每个war包都有不同的webroot,这个webroot需要是basePath的前缀,比如webroot为test,则该微服务所有的契约都必须以/test打头。 - -当微服务加载在web容器中,并直接使用web容器开的http、https端口时,因为是使用的web容器的通信通道,所以需要满足web容器的规则。 - -## +Restful calls should be isolated from other static resource calls (such as html, js, etc.) in the web container, so there should be a layer of keywords in the post after webroot, such as the example in web.xml above (/test/rest) In the rest. +Take tomcat as an example. By default, each war package has a different webroot. This webroot needs to be a basePath prefix. For example, if webroot is testing, all the contracts of the microservice must start with /test. +When the microservice is loaded in the web container and directly uses the http and https ports opened by the web container, it is necessary to satisfy the rules of the web container because it is the communication channel of the web container used. +##
[incubator-servicecomb-docs] 03/04: correct packaging translation mistakes
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 3e3e43d748f778b0cc49ecc1b84f49eb4561fd43 Author: DeanLee AuthorDate: Tue Aug 21 14:01:22 2018 +0800 correct packaging translation mistakes --- java-chassis-reference/en_US/packaging/standalone.md| 5 +++-- java-chassis-reference/en_US/packaging/web-container.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java-chassis-reference/en_US/packaging/standalone.md b/java-chassis-reference/en_US/packaging/standalone.md index 0966089..f9f0534 100644 --- a/java-chassis-reference/en_US/packaging/standalone.md +++ b/java-chassis-reference/en_US/packaging/standalone.md @@ -7,8 +7,9 @@ A Standalone container that loads Spring with a simple Main, because the service * **Step 1** Write the Main function, initialize the log and load the service configuration as follows: ```java -import com.huawei.paas.foundation.common.utils.BeanUtils; -import com.huawei.paas.foundation.common.utils.Log4jUtils; +import org.apache.servicecomb.foundation.common.utils.BeanUtils; +import org.apache.servicecomb.foundation.common.utils.Log4jUtils; + public class MainServer { public static void main(String[] args) throws Exception { Log4jUtils.init(); # Log initialization diff --git a/java-chassis-reference/en_US/packaging/web-container.md b/java-chassis-reference/en_US/packaging/web-container.md index 63acefa..b435acb 100644 --- a/java-chassis-reference/en_US/packaging/web-container.md +++ b/java-chassis-reference/en_US/packaging/web-container.md @@ -1,6 +1,6 @@ ## Concept Description -If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you can not write or write a small amount of boot code as needed. +If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you just need write few lines of code ## Development example
[incubator-servicecomb-docs] 01/04: update java-chassis-reference/en_US/packaging/standalone.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit dc3e6f0516faaaf70df98b415779823d55a52346 Author: DeanLee AuthorDate: Mon Aug 20 14:50:04 2018 +0800 update java-chassis-reference/en_US/packaging/standalone.md --- java-chassis-reference/en_US/packaging/standalone.md | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/java-chassis-reference/en_US/packaging/standalone.md b/java-chassis-reference/en_US/packaging/standalone.md index 9b0dc25..0966089 100644 --- a/java-chassis-reference/en_US/packaging/standalone.md +++ b/java-chassis-reference/en_US/packaging/standalone.md @@ -1,25 +1,24 @@ -## 概念阐述 +## Concept Description -一个Standalone的容器,以简单的Main加载Spring启动,因为服务通常不需要Tomcat/JBoss等Web容器的特性,没必要用Web容器去加载服务。微框架提供了standalone部署运行模式,服务容器只是一个简单的Main方法,并加载一个简单的Spring容器,用于暴露服务。 +A Standalone container that loads Spring with a simple Main, because the service usually does not require the properties of a Web container such as Tomcat/JBoss, and there is no need to use the Web container to load the service. The microframework provides a standalone deployment run mode. The service container is just a simple Main method and loads a simple Spring container to expose the service. -## 操作步骤 +## Operation steps -* **步骤1** 编写Main函数,初始化日志和加载服务配置,内容如下: +* **Step 1** Write the Main function, initialize the log and load the service configuration as follows: ```java import com.huawei.paas.foundation.common.utils.BeanUtils; import com.huawei.paas.foundation.common.utils.Log4jUtils; public class MainServer { public static void main(String[] args) throws Exception { - Log4jUtils.init(); # 日志初始化 - BeanUtils.init(); # Spring bean初始化 + Log4jUtils.init(); # Log initialization + BeanUtils.init(); # Spring bean initialization } } ``` -* **步骤2** 运行MainServer即可启动该微服务进程,向外暴露服务。 +* **Step 2** Run the MainServer to start the microservice process and expose the service. -## 注意事项 - -如果使用的是rest网络通道,需要将pom中的transport改为使用cse-transport-rest-vertx包 +## Notes +If you are using the rest network channel, you need to change the transport in the pom to use the cse-transport-rest-vertx package.
[GitHub] liubao68 closed pull request #38: update Packaging dir translation
liubao68 closed pull request #38: update Packaging dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/38 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/java-chassis-reference/en_US/packaging/standalone.md b/java-chassis-reference/en_US/packaging/standalone.md index 9b0dc25..f9f0534 100644 --- a/java-chassis-reference/en_US/packaging/standalone.md +++ b/java-chassis-reference/en_US/packaging/standalone.md @@ -1,25 +1,25 @@ -## 概念阐述 +## Concept Description -一个Standalone的容器,以简单的Main加载Spring启动,因为服务通常不需要Tomcat/JBoss等Web容器的特性,没必要用Web容器去加载服务。微框架提供了standalone部署运行模式,服务容器只是一个简单的Main方法,并加载一个简单的Spring容器,用于暴露服务。 +A Standalone container that loads Spring with a simple Main, because the service usually does not require the properties of a Web container such as Tomcat/JBoss, and there is no need to use the Web container to load the service. The microframework provides a standalone deployment run mode. The service container is just a simple Main method and loads a simple Spring container to expose the service. -## 操作步骤 +## Operation steps -* **步骤1** 编写Main函数,初始化日志和加载服务配置,内容如下: +* **Step 1** Write the Main function, initialize the log and load the service configuration as follows: ```java -import com.huawei.paas.foundation.common.utils.BeanUtils; -import com.huawei.paas.foundation.common.utils.Log4jUtils; +import org.apache.servicecomb.foundation.common.utils.BeanUtils; +import org.apache.servicecomb.foundation.common.utils.Log4jUtils; + public class MainServer { public static void main(String[] args) throws Exception { - Log4jUtils.init(); # 日志初始化 - BeanUtils.init(); # Spring bean初始化 + Log4jUtils.init(); # Log initialization + BeanUtils.init(); # Spring bean initialization } } ``` -* **步骤2** 运行MainServer即可启动该微服务进程,向外暴露服务。 - -## 注意事项 +* **Step 2** Run the MainServer to start the microservice process and expose the service. -如果使用的是rest网络通道,需要将pom中的transport改为使用cse-transport-rest-vertx包 +## Notes +If you are using the rest network channel, you need to change the transport in the pom to use the cse-transport-rest-vertx package. diff --git a/java-chassis-reference/en_US/packaging/web-container.md b/java-chassis-reference/en_US/packaging/web-container.md index 7b11276..bd4e39e 100644 --- a/java-chassis-reference/en_US/packaging/web-container.md +++ b/java-chassis-reference/en_US/packaging/web-container.md @@ -1,20 +1,17 @@ -## 概念阐述 +## Concept Description -如果需要将该微服务加载到web容器中启动运行时,需要新建一个servlet工程包装一下,该servlet工程,根据需要,可以不写或写少量的引导代码即可。 +If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you just need to write few lines of code -## 开发示例 +## Development example -参考“开发服务提供者” - “通信协议" - "REST over Servlet"章节。 +Refer to the "Development Service Provider" -> "Communication Protocol" -> "REST over Servlet" chapter. -## 注意事项 +## Notes -Restful调用应该与web容器中其他静态资源调用(比如html、js等等)隔离开来,所以webroot后一段应该还有一层关键字,比如上面web.xml中举的例子(/test/rest)中的rest。 - -以tomcat为例,默认每个war包都有不同的webroot,这个webroot需要是basePath的前缀,比如webroot为test,则该微服务所有的契约都必须以/test打头。 - -当微服务加载在web容器中,并直接使用web容器开的http、https端口时,因为是使用的web容器的通信通道,所以需要满足web容器的规则。 - -## +Restful calls should be isolated from other static resource calls (such as html, js, etc.) in the web container, so there should be a layer of keywords in the post after webroot, such as the example in web.xml above (/test/rest) In the rest. +Take tomcat as an example. By default, each war package has a different webroot. This webroot needs to be a basePath prefix. For example, if webroot is testing, all the contracts of the microservice must start with /test. +When the microservice is loaded in the web container and directly uses the http and https ports opened by the web container, it is necessary to satisfy the rules of the web container because it is the communication channel of the web container used. +## diff --git a/java-chassis-reference/zh_CN/packaging/standalone.md b/java-chassis-reference/zh_CN/packaging/standalone.md index 9b0dc25..cff8b42 100644 --- a/java-chassis-reference/zh_CN/packaging/standalone.md +++ b/java-chassis-reference/zh_CN/packaging/standalone.md @@ -7,8 +7,8 @@ * **步骤1** 编写Main函数,初始化日志和加载服务配置,内容如下: ```java -import com.huawei.paas.foundation.common.utils.BeanUtils; -import com.huawei.paas.foundation.common.utils.Log4jUtils; +import org.apache.servicecomb.foundation.common.utils.BeanUtils; +import org.apache.servicecomb.foundation.common.utils.Log4jUtils; public class MainServer { public static void main(String[] args) throws Exception { Log4jUtils.init(); # 日志初始化 This is an automated message from the
[GitHub] liubao68 commented on a change in pull request #39: References handlers dir translation
liubao68 commented on a change in pull request #39: References handlers dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/39#discussion_r211521316 ## File path: java-chassis-reference/en_US/references-handlers/intruduction.md ## @@ -1,9 +1,9 @@ -## 处理链参考 -处理链(Handlers)是ServiceComb的核心组成部分,它们构成服务运行管控的基础。ServiceComb通过处理链来处理负载均衡、熔断容错、流量控制等。 +## Processing Chain Reference +Handlers are the core components of ServiceComb, which form the basis of service operation and control. ServiceComb handles load balancing, fuse tolerance, flow control, and more through the processing chain. -## 开发处理链 -开发者自定义处理链包含如下几个步骤。由于ServiceComb的核心组成就是处理链,开发者可以参考handlers目录的实现详细了解处理链。下面简单总结下几个关键步骤: +## Development Processing Chain Review comment: Writing Handlers This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-saga] 01/04: SCB-855 Support JDK7 in saga-format
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit db95f8b80de1714837a55a13bcb2c0aac805eeba Author: KomachiSion <263976...@qq.com> AuthorDate: Tue Aug 21 13:56:04 2018 +0800 SCB-855 Support JDK7 in saga-format --- .../servicecomb/saga/format/ChildrenExtractor.java | 8 +++- .../saga/format/JacksonRestOperation.java | 7 +++- .../saga/format/JacksonSagaEventFormat.java| 47 ++ .../saga/format/JsonSagaDefinition.java| 5 ++- 4 files changed, 55 insertions(+), 12 deletions(-) diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java index cfd3b1c..58cb1eb 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java @@ -21,6 +21,8 @@ import java.io.IOException; import java.util.HashSet; import java.util.Set; +import com.fasterxml.jackson.databind.JsonNode; + import org.apache.servicecomb.saga.core.SagaException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -31,6 +33,7 @@ import org.apache.servicecomb.saga.core.application.interpreter.FromJsonFormat; public class ChildrenExtractor implements FromJsonFormat> { private static final String SAGA_CHILDREN = "sagaChildren"; + private final ObjectMapper objectMapper = new ObjectMapper(); @Override @@ -46,8 +49,9 @@ public class ChildrenExtractor implements FromJsonFormat> { Set children = new HashSet<>(); if (value.has(SAGA_CHILDREN)) { - value.get(SAGA_CHILDREN) - .forEach(node -> children.add(node.textValue())); + for (JsonNode node : value.get(SAGA_CHILDREN)) { +children.add(node.textValue()); + } } return children; diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java index 4d42451..10876fa 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java @@ -51,7 +51,12 @@ class JacksonRestOperation extends RestOperation implements TransportAware { @Override public SagaResponse send(String address, SagaResponse response) { Map> updated = new HashMap<>(params()); -updated.computeIfAbsent("form", (key) -> new HashMap<>()).put("response", response.body()); +// This is not thread safe +if (updated.get("form") == null) { + HashMap formMap = new HashMap<>(); + formMap.put("response", response.body()); + updated.put("form", formMap); +} return transport.with( address, diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java index 1b416aa..8b365c6 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java @@ -20,7 +20,6 @@ package org.apache.servicecomb.saga.format; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import java.util.function.BiFunction; import org.apache.servicecomb.saga.core.FailedSagaRequestContext; import org.apache.servicecomb.saga.core.NoOpSagaRequest; @@ -40,12 +39,42 @@ import org.apache.servicecomb.saga.core.TransactionEndedEvent; public class JacksonSagaEventFormat implements SagaEventFormat { private final Map> eventFactories = new HashMap>() {{ -put(SagaStartedEvent.class.getSimpleName(), (sagaId, json) -> sagaStartedEvent(sagaId, json)); -put(TransactionStartedEvent.class.getSimpleName(), (sagaId, json) -> transactionStartedEvent(sagaId, json)); -put(TransactionEndedEvent.class.getSimpleName(), (sagaId, json) -> transactionEndedEvent(sagaId, json)); -put(TransactionAbortedEvent.class.getSimpleName(), (sagaId, json) -> transactionAbortedEvent(sagaId, json)); -put(TransactionCompensatedEvent.class.getSimpleName(), (sagaId, json) -> compensationEndedEvent(sagaId, json)); -put(SagaEndedEvent.class.getSimpleName(), (sagaId, json) -> sagaEndedEvent(sagaId)); +put(SagaStartedEvent.class.getSimpleName(), new BiFunction() { + @Override + public SagaEvent apply(String sagaId, String json) { +return sagaStartedEvent(sagaId, json); + } +}); +put(TransactionStartedEvent.class.getSimpleName(), new BiFunction() { + @Override + public SagaEvent apply(String sagaId, String json) { +return
[incubator-servicecomb-saga] branch master updated (13e5646 -> d64f3fc)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git. from 13e5646 Fix the formate issue README new db95f8b SCB-855 Support JDK7 in saga-format new d300e17 SCB-855 Support JDK7 in saga-format test new 00a6f40 SCB-855 change maven-compiler supported jdk7 new d64f3fc SCB-855 extract an empty map constant The 4 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: saga-format/pom.xml| 18 - .../servicecomb/saga/format/ChildrenExtractor.java | 8 ++- .../saga/format/JacksonRestOperation.java | 7 +- .../saga/format/JacksonSagaEventFormat.java| 47 +++-- .../saga/format/JsonSagaDefinition.java| 5 +- .../saga/format/JacksonFromJsonFormatTest.java | 82 -- .../saga/format/JacksonRestOperationTest.java | 11 ++- .../saga/format/JsonRestSagaRequestTest.java | 8 ++- .../saga/format/SagaEventFormatTest.java | 10 ++- 9 files changed, 154 insertions(+), 42 deletions(-)
[incubator-servicecomb-saga] 04/04: SCB-855 extract an empty map constant
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit d64f3fc97005d03f55a1bd9a9c0014c307ba824f Author: KomachiSion <263976...@qq.com> AuthorDate: Tue Aug 21 16:29:28 2018 +0800 SCB-855 extract an empty map constant --- .../servicecomb/saga/format/JacksonFromJsonFormatTest.java | 12 +++- .../apache/servicecomb/saga/format/SagaEventFormatTest.java | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java index 8214cc1..f2ae724 100644 --- a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java +++ b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java @@ -152,6 +152,8 @@ public class JacksonFromJsonFormatTest { private final TransportFactory transportFactory = Mockito.mock(TransportFactory.class); private final FromJsonFormat format = new JacksonFromJsonFormat(transportFactory); + private final Map> EMPTY_MAP = Collections.>emptyMap(); + private final Function getRequestId = new Function() { @Override public String apply(SagaRequest sagaRequest) { @@ -195,24 +197,24 @@ public class JacksonFromJsonFormatTest { .thenReturn(response11); when(restTransport.with("aaa", "/rest/as", "delete", singletonMap("query", singletonMap("bar", "as" .thenReturn(response12); -when(restTransport.with("aaa", "/rest/as", "put", Collections.>emptyMap())) +when(restTransport.with("aaa", "/rest/as", "put", EMPTY_MAP)) .thenReturn(response13); when(restTransport .with("bbb", "/rest/bs", "post", mapOf("query", singletonMap("foo", "bs"), "json", singletonMap("body", "{ \"bar\": \"bs\" }" .thenReturn(response21); -when(restTransport.with("bbb", "/rest/bs", "delete", Collections.>emptyMap())) +when(restTransport.with("bbb", "/rest/bs", "delete", EMPTY_MAP)) .thenReturn(response22); -when(restTransport.with("bbb", "/rest/bs", "put", Collections.>emptyMap())) +when(restTransport.with("bbb", "/rest/bs", "put", EMPTY_MAP)) .thenReturn(response23); when(restTransport .with("ccc", "/rest/cs", "post", mapOf("query", singletonMap("foo", "cs"), "form", singletonMap("bar", "cs" .thenReturn(response31); -when(restTransport.with("ccc", "/rest/cs", "delete", Collections.>emptyMap())) +when(restTransport.with("ccc", "/rest/cs", "delete", EMPTY_MAP)) .thenReturn(response32); -when(restTransport.with("ccc", "/rest/cs", "put", Collections.>emptyMap())) +when(restTransport.with("ccc", "/rest/cs", "put", EMPTY_MAP)) .thenReturn(response33); } diff --git a/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java b/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java index 70bc4b8..fc509e4 100644 --- a/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java +++ b/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java @@ -62,13 +62,14 @@ import org.apache.servicecomb.saga.transports.RestTransport; public class SagaEventFormatTest { private final String sagaId = Randomness.uniquify("sagaId"); + private final Map> EMPTY_MAP = Collections.>emptyMap(); private final SagaRequest request = new SagaRequestImpl( sagaId, Randomness.uniquify("serviceName"), TYPE_REST, new JacksonRestTransaction("/rest/xxx", "POST", singletonMap("query", singletonMap("foo", "xxx"))), new JacksonRestCompensation("/rest/xxx", "DELETE", singletonMap("query", singletonMap("bar", "xxx"))), - new JacksonRestFallback(TYPE_REST, "/rest/xxx", "PUT", Collections.>emptyMap()) + new JacksonRestFallback(TYPE_REST, "/rest/xxx", "PUT", EMPTY_MAP) ); private final RestTransport restTransport = Mockito.mock(RestTransport.class);
[incubator-servicecomb-saga] 02/04: SCB-855 Support JDK7 in saga-format test
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit d300e17a6adc9df463d3b49a447818eed208e1b0 Author: KomachiSion <263976...@qq.com> AuthorDate: Tue Aug 21 13:56:19 2018 +0800 SCB-855 Support JDK7 in saga-format test --- .../saga/format/JacksonFromJsonFormatTest.java | 80 -- .../saga/format/JacksonRestOperationTest.java | 11 ++- .../saga/format/JsonRestSagaRequestTest.java | 8 ++- .../saga/format/SagaEventFormatTest.java | 9 ++- 4 files changed, 79 insertions(+), 29 deletions(-) diff --git a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java index bbf7510..8214cc1 100644 --- a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java +++ b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java @@ -18,7 +18,6 @@ package org.apache.servicecomb.saga.format; import static com.seanyinx.github.unit.scaffolding.Randomness.uniquify; -import static java.util.Collections.emptyMap; import static java.util.Collections.singletonMap; import static org.hamcrest.Matchers.contains; import static org.hamcrest.core.Is.is; @@ -27,12 +26,7 @@ import static org.junit.Assert.assertThat; import static org.mockito.Mockito.when; import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; +import java.util.*; import org.apache.servicecomb.saga.core.Operation; import org.apache.servicecomb.saga.core.SagaException; @@ -158,6 +152,41 @@ public class JacksonFromJsonFormatTest { private final TransportFactory transportFactory = Mockito.mock(TransportFactory.class); private final FromJsonFormat format = new JacksonFromJsonFormat(transportFactory); + private final Function getRequestId = new Function() { +@Override +public String apply(SagaRequest sagaRequest) { + return sagaRequest.id(); +} + }; + + private final Function getRequestServiceName = new Function() { +@Override +public String apply(SagaRequest sagaRequest) { + return sagaRequest.serviceName(); +} + }; + + private final Function getRequestType = new Function() { +@Override +public String apply(SagaRequest sagaRequest) { + return sagaRequest.type(); +} + }; + + private final Function getCompensationRetries = new Function() { +@Override +public Integer apply(SagaRequest sagaRequest) { + return sagaRequest.compensation().retries(); +} + }; + + private final Function getFallbackType = new Function() { +@Override +public String apply(SagaRequest sagaRequest) { + return sagaRequest.fallback().type(); +} + }; + @Before public void setUp() throws Exception { when(transportFactory.restTransport()).thenReturn(restTransport); @@ -166,23 +195,24 @@ public class JacksonFromJsonFormatTest { .thenReturn(response11); when(restTransport.with("aaa", "/rest/as", "delete", singletonMap("query", singletonMap("bar", "as" .thenReturn(response12); -when(restTransport.with("aaa", "/rest/as", "put", emptyMap())) +when(restTransport.with("aaa", "/rest/as", "put", Collections.>emptyMap())) .thenReturn(response13); when(restTransport -.with("bbb", "/rest/bs", "post", mapOf("query", singletonMap("foo", "bs"), "json", singletonMap("body", "{ \"bar\": \"bs\" }" +.with("bbb", "/rest/bs", "post", +mapOf("query", singletonMap("foo", "bs"), "json", singletonMap("body", "{ \"bar\": \"bs\" }" .thenReturn(response21); -when(restTransport.with("bbb", "/rest/bs", "delete", emptyMap())) +when(restTransport.with("bbb", "/rest/bs", "delete", Collections.>emptyMap())) .thenReturn(response22); -when(restTransport.with("bbb", "/rest/bs", "put", emptyMap())) +when(restTransport.with("bbb", "/rest/bs", "put", Collections.>emptyMap())) .thenReturn(response23); when(restTransport .with("ccc", "/rest/cs", "post", mapOf("query", singletonMap("foo", "cs"), "form", singletonMap("bar", "cs" .thenReturn(response31); -when(restTransport.with("ccc", "/rest/cs", "delete", emptyMap())) +when(restTransport.with("ccc", "/rest/cs", "delete", Collections.>emptyMap())) .thenReturn(response32); -when(restTransport.with("ccc", "/rest/cs", "put", emptyMap())) +when(restTransport.with("ccc", "/rest/cs", "put", Collections.>emptyMap())) .thenReturn(response33); } @@ -190,12 +220,12 @@ public class JacksonFromJsonFormatTest { public void
[incubator-servicecomb-saga] 03/04: SCB-855 change maven-compiler supported jdk7
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 00a6f4087aeed3566b5affba4409e4e1618c8c32 Author: KomachiSion <263976...@qq.com> AuthorDate: Tue Aug 21 13:58:33 2018 +0800 SCB-855 change maven-compiler supported jdk7 --- saga-format/pom.xml | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/saga-format/pom.xml b/saga-format/pom.xml index 79e6fad..b69473b 100644 --- a/saga-format/pom.xml +++ b/saga-format/pom.xml @@ -16,7 +16,8 @@ ~ limitations under the License. --> -http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> saga org.apache.servicecomb.saga @@ -71,4 +72,19 @@ + + + +org.apache.maven.plugins +maven-compiler-plugin +3.1 + + UTF-8 + 1.7 + 1.7 + + + + +
[GitHub] WillemJiang closed pull request #258: [SCB-855]Support JDK7 in saga-format
WillemJiang closed pull request #258: [SCB-855]Support JDK7 in saga-format URL: https://github.com/apache/incubator-servicecomb-saga/pull/258 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/saga-format/pom.xml b/saga-format/pom.xml index 79e6fadc..b69473b7 100644 --- a/saga-format/pom.xml +++ b/saga-format/pom.xml @@ -16,7 +16,8 @@ ~ limitations under the License. --> -http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> saga org.apache.servicecomb.saga @@ -71,4 +72,19 @@ + + + +org.apache.maven.plugins +maven-compiler-plugin +3.1 + + UTF-8 + 1.7 + 1.7 + + + + + diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java index cfd3b1c4..58cb1eb1 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java @@ -21,6 +21,8 @@ import java.util.HashSet; import java.util.Set; +import com.fasterxml.jackson.databind.JsonNode; + import org.apache.servicecomb.saga.core.SagaException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -31,6 +33,7 @@ public class ChildrenExtractor implements FromJsonFormat> { private static final String SAGA_CHILDREN = "sagaChildren"; + private final ObjectMapper objectMapper = new ObjectMapper(); @Override @@ -46,8 +49,9 @@ Set children = new HashSet<>(); if (value.has(SAGA_CHILDREN)) { - value.get(SAGA_CHILDREN) - .forEach(node -> children.add(node.textValue())); + for (JsonNode node : value.get(SAGA_CHILDREN)) { +children.add(node.textValue()); + } } return children; diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java index 4d424517..10876faa 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java @@ -51,7 +51,12 @@ public SagaResponse send(String address) { @Override public SagaResponse send(String address, SagaResponse response) { Map> updated = new HashMap<>(params()); -updated.computeIfAbsent("form", (key) -> new HashMap<>()).put("response", response.body()); +// This is not thread safe +if (updated.get("form") == null) { + HashMap formMap = new HashMap<>(); + formMap.put("response", response.body()); + updated.put("form", formMap); +} return transport.with( address, diff --git a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java index 1b416aaf..8b365c67 100644 --- a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java +++ b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.HashMap; import java.util.Map; -import java.util.function.BiFunction; import org.apache.servicecomb.saga.core.FailedSagaRequestContext; import org.apache.servicecomb.saga.core.NoOpSagaRequest; @@ -40,12 +39,42 @@ public class JacksonSagaEventFormat implements SagaEventFormat { private final Map> eventFactories = new HashMap>() {{ -put(SagaStartedEvent.class.getSimpleName(), (sagaId, json) -> sagaStartedEvent(sagaId, json)); -put(TransactionStartedEvent.class.getSimpleName(), (sagaId, json) -> transactionStartedEvent(sagaId, json)); -put(TransactionEndedEvent.class.getSimpleName(), (sagaId, json) -> transactionEndedEvent(sagaId, json)); -put(TransactionAbortedEvent.class.getSimpleName(), (sagaId, json) -> transactionAbortedEvent(sagaId, json)); -put(TransactionCompensatedEvent.class.getSimpleName(), (sagaId, json) -> compensationEndedEvent(sagaId, json)); -put(SagaEndedEvent.class.getSimpleName(), (sagaId, json) -> sagaEndedEvent(sagaId)); +put(SagaStartedEvent.class.getSimpleName(), new BiFunction() { + @Override + public SagaEvent
[GitHub] liubao68 closed pull request #37: update question-and-answer translation
liubao68 closed pull request #37: update question-and-answer translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/37 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md index 2ef0fed..4d11828 100644 --- a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md +++ b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md @@ -1,39 +1,37 @@ -在进行微服务持续迭代开发的过程中,由于新特性在不停的加入,一些过时的特性在不停的修改,接口兼容问题面临巨大的挑战,特别是在运行环境多版本共存(灰度发布)的情况下。本章节主要描述接口兼容管理的一些实践建议,以及在使用过程中碰到了兼容性问题的解决办法。由于微服务一般都通过REST接口对外提供服务,没有特殊说明的情况下,这里的接口都指REST接口。 +In the process of continuous iterative development of microservices, due to the continuous addition of new features, some old features are continually being modified, and interface compatibility issues face enormous challenges, especially in the running environment multi-version coexistence (grayscale release) ). This chapter mainly describes some practical suggestions for interface compatibility management and solutions to compatibility problems during use. Since microservices generally provide services externally through the REST interface, the interface here refers to the REST interface without special instructions. -# 保证接口兼容的实践 +# Practice of ensuring interface compatibility -为了防止接口兼容问题,开发者在进行接口变更(新增、修改、删除等)的时候,建议遵循下面的一些原则。 +To prevent interface compatibility problems, developers are advised to follow the following principles when making interface changes (add, modify, delete, etc.). -1. 只增加接口,不修改、不删除接口。 -2. 作为Provider,增加接口的时候,相应的将微服务版本号递增。比如将2.1.2修改为2.1.3。 -3. 作为Consumer,使用Provider的新接口时候,指定Provider的最小版本号。比如:servicecomb.references.\[serviceName\].version-rule=2.1.3+,其中serviceName为Provider的微服务名称。 -4. 在服务中心,定期清理不再使用的老版本的微服务信息。 +1. Only add interfaces, do not modify or delete interfaces. +2. As a Provider, when adding an interface, the microservice version number is incremented accordingly. For example, change 2.1.2 to 2.1.3. +3. As a Consumer, when using the new interface of the Provider, specify the minimum version number of the Provider. For example: servicecomb.references.\[serviceName\].version-rule=2.1.3+, The serviceName is the Provider's microservice name. +4. In the service center, regularly clean up the old version of microservice information that is no longer used. -ServiceComb还有如下一些注意事项: -1. 修改微服务信息,必须升级版本号,因为服务注册的时候,不会覆盖已经注册的微服务信息。 +ServiceComb also has the following considerations: +1. When modifying the microservice information, you must upgrade the version number, because the service will not overwrite the registered microservice information. -# 接口兼容常见问题及其解决办法 +# interface compatibility common problems and their solutions -开发阶段,由于存在频繁的接口修改,也不会清理服务中心的数据,容易出现调试的时候接口调用失败的情况。建议开发者可以安装下载一个[服务中心的frontend](http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), 可以随时清理服务中心数据。 +During the development phase, due to various interface modification, the data of the service center would not be cleaned up, and the interface call fails when debugging. Developers are advised to install and download a [frontend] of the service center (http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), anytime Clean up service center data. -如果使用华为公有云在线的服务中心,可以直接登录使用微服务引擎提供的管理功能进行删除。 +If you use Huawei's public cloud online service center, you can log in directly using the management functions provided by the microservice engine to delete. -发布阶段,需要审视下接口兼容的实践的步骤,确保不在线上引入接口兼容问题。 +During the release phase, you need to review the steps of the interface-compatible practices to ensure that interface compatibility issues are not online. -如果不小心漏了其中的某个步骤,则可能导致如下一些接口兼容问题: +If you accidentally miss one of these steps, it may lead to the following interface compatibility issues: -1. 如果修改、删除接口:导致一些老的Consumer将请求路由到新的Provider,调用失败。 -2. 如果忘记修改微服务版本号:导致一些新的Consumer将请求路由到老的Provider,调用失败。 -3. 如果忘记配置Consumer的最小依赖版本:当部署顺序为先停止Consumer,再启动Consumer,再停止Provider,再启动Provider的情况,Consumer无法获取到新接口信息,就采用了老接口,当Provider启动以后,Consumer发起对新接口的调用会失败;或者在Provider没启动前,调用新接口失败等。 +1. If the interface is modified or deleted: some old Consumers will fail to request the new route of the new Provider. +2. If you forget to modify the microservice version number: some new Consumers will fail to request the route of the old Provider. +3. If you forget to configure the minimum dependent version of the Consumer: when the deployment order is to stop the Consumer first, then start the Consumer, then stop the Provider, and then start the Provider. The Consumer cannot
[incubator-servicecomb-docs] 06/06: delete useless file question-and-answer service-center-error-diagnosis.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit b64ccd562deec05f8a83aa28c1f9ea0ff3d40c91 Author: DeanLee AuthorDate: Tue Aug 21 12:36:15 2018 +0800 delete useless file question-and-answer service-center-error-diagnosis.md --- .../service-center-error-diagnosis.md | 80 - .../service-center-error-diagnosis.md | 81 -- 2 files changed, 161 deletions(-) diff --git a/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md b/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md deleted file mode 100644 index 89fed6d..000 --- a/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md +++ /dev/null @@ -1,80 +0,0 @@ -Developers can directly use the service center provided by Huawei Public Cloud for development work. To use the service center, the developer needs to register the Huawei cloud account and generate AK/SK information in "My Credentials" for access to the authentication control. For details on how to access Huawei cloud, see "[Huawei Public Cloud Deployment] (/start/deployment-on-cloud.md)." - -This chapter focuses on some common anomalies in the Connection Service Center and their Troubleshooting method. - -# \#1 - -* Exception message - -{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Invalid request, header is invalid, ak sk or project is empty."} - -* Reason of problem - -AK, SK is not set correctly and carried into the request header. - -* Troubleshooting method - -Check if the following authentication modules are used in the project. (Indirect dependencies are also possible, such as relying on cse-solution-service-engine\) - -``` -com.huawei.paas.cse -foundation-auth -``` - -Check if the ak/sk configuration in microservice.yaml is correct, whether the accessKey and secretKey are filled in incorrectly, and the length of the secretKey is longer than the accessKey. - -``` -servicecomb: - credentials: -accessKey: your access key -secretKey: your serect key -akskCustomCipher: default -``` - -You can log in to Huawei Cloud and query the accessKey information in "My Credentials". The secretKey is saved by the user and cannot be queried. If you forget the relevant credentials, you can delete the voucher information and generate new voucher information. - -# \#2 - -* Exception message - -{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"validate ak sk error\"}"} - -* Reason of problem - -AK, SK are not correct. - -* Troubleshooting method - -Check if the ak/sk configuration in microservice.yaml is correct. You can log in to Huawei Cloud and query the accessKey information in "My Credentials". The secretKey is saved by the user and cannot be queried. If you forget the relevant credentials, you can delete the voucher information and generate new voucher information. - -# \#3 - -* Exception message - -{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"get project token from iam failed. error:http post failed, statuscode: 400\"}"} - -* Reason of problem - -The Project name is incorrect. - -* Troubleshooting method - -Check if the value of the configuration item servicecomb.credentials.project is correct, and query the correct Project name in "My Credentials". If there is no such configuration item, the default will be based on the domain name of the service center. When the domain name does not contain a legal Project name, you need to add this configuration item to ensure that its name is the legal Project name in "My Credentials". - -# \#4 - -* Exception message - -{"errorCode":"41","errorMessage":"Invalid parameter\(s\)","detail":"Version validate failed, rule: {Length: 64,Length: ^\[a-zA-Z0-9\_ - -[\\-.\]\*$}](\\-.]*$}) - -"} - -* Reason of problem - -Use the new version of the SDK to connect to an older version of the Service Center. - -* Troubleshooting method - -Check the version of the service center. You can download the latest version of the service center from the Huawei Cloud official website, or download the latest version of the service center from ServiceComb's official website. \ No newline at end of file diff --git a/java-chassis-reference/zh_CN/question-and-answer/service-center-error-diagnosis.md b/java-chassis-reference/zh_CN/question-and-answer/service-center-error-diagnosis.md deleted file mode 100644 index 4a02e06..000 --- a/java-chassis-reference/zh_CN/question-and-answer/service-center-error-diagnosis.md +++ /dev/null @@ -1,81 +0,0 @@
[incubator-servicecomb-docs] 02/06: update java-chassis-reference/en_US/question-and-answer/interface-compatibility.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 152f51f684eb61868a7ebb1083151a216125f9bc Author: DeanLee AuthorDate: Mon Aug 20 11:53:53 2018 +0800 update java-chassis-reference/en_US/question-and-answer/interface-compatibility.md --- .../question-and-answer/interface-compatibility.md | 42 +++--- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md index 2ef0fed..4d11828 100644 --- a/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md +++ b/java-chassis-reference/en_US/question-and-answer/interface-compatibility.md @@ -1,39 +1,37 @@ -在进行微服务持续迭代开发的过程中,由于新特性在不停的加入,一些过时的特性在不停的修改,接口兼容问题面临巨大的挑战,特别是在运行环境多版本共存(灰度发布)的情况下。本章节主要描述接口兼容管理的一些实践建议,以及在使用过程中碰到了兼容性问题的解决办法。由于微服务一般都通过REST接口对外提供服务,没有特殊说明的情况下,这里的接口都指REST接口。 +In the process of continuous iterative development of microservices, due to the continuous addition of new features, some old features are continually being modified, and interface compatibility issues face enormous challenges, especially in the running environment multi-version coexistence (grayscale release) ). This chapter mainly describes some practical suggestions for interface compatibility management and solutions to compatibility problems during use. Since microservices generally [...] -# 保证接口兼容的实践 +# Practice of ensuring interface compatibility -为了防止接口兼容问题,开发者在进行接口变更(新增、修改、删除等)的时候,建议遵循下面的一些原则。 +To prevent interface compatibility problems, developers are advised to follow the following principles when making interface changes (add, modify, delete, etc.). -1. 只增加接口,不修改、不删除接口。 -2. 作为Provider,增加接口的时候,相应的将微服务版本号递增。比如将2.1.2修改为2.1.3。 -3. 作为Consumer,使用Provider的新接口时候,指定Provider的最小版本号。比如:servicecomb.references.\[serviceName\].version-rule=2.1.3+,其中serviceName为Provider的微服务名称。 -4. 在服务中心,定期清理不再使用的老版本的微服务信息。 +1. Only add interfaces, do not modify or delete interfaces. +2. As a Provider, when adding an interface, the microservice version number is incremented accordingly. For example, change 2.1.2 to 2.1.3. +3. As a Consumer, when using the new interface of the Provider, specify the minimum version number of the Provider. For example: servicecomb.references.\[serviceName\].version-rule=2.1.3+, The serviceName is the Provider's microservice name. +4. In the service center, regularly clean up the old version of microservice information that is no longer used. -ServiceComb还有如下一些注意事项: -1. 修改微服务信息,必须升级版本号,因为服务注册的时候,不会覆盖已经注册的微服务信息。 +ServiceComb also has the following considerations: +1. When modifying the microservice information, you must upgrade the version number, because the service will not overwrite the registered microservice information. -# 接口兼容常见问题及其解决办法 +# interface compatibility common problems and their solutions -开发阶段,由于存在频繁的接口修改,也不会清理服务中心的数据,容易出现调试的时候接口调用失败的情况。建议开发者可以安装下载一个[服务中心的frontend](http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), 可以随时清理服务中心数据。 +During the development phase, due to various interface modification, the data of the service center would not be cleaned up, and the interface call fails when debugging. Developers are advised to install and download a [frontend] of the service center (http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0-m1/), anytime Clean up service center data. -如果使用华为公有云在线的服务中心,可以直接登录使用微服务引擎提供的管理功能进行删除。 +If you use Huawei's public cloud online service center, you can log in directly using the management functions provided by the microservice engine to delete. -发布阶段,需要审视下接口兼容的实践的步骤,确保不在线上引入接口兼容问题。 +During the release phase, you need to review the steps of the interface-compatible practices to ensure that interface compatibility issues are not online. -如果不小心漏了其中的某个步骤,则可能导致如下一些接口兼容问题: +If you accidentally miss one of these steps, it may lead to the following interface compatibility issues: -1. 如果修改、删除接口:导致一些老的Consumer将请求路由到新的Provider,调用失败。 -2. 如果忘记修改微服务版本号:导致一些新的Consumer将请求路由到老的Provider,调用失败。 -3. 如果忘记配置Consumer的最小依赖版本:当部署顺序为先停止Consumer,再启动Consumer,再停止Provider,再启动Provider的情况,Consumer无法获取到新接口信息,就采用了老接口,当Provider启动以后,Consumer发起对新接口的调用会失败;或者在Provider没启动前,调用新接口失败等。 +1. If the interface is modified or deleted: some old Consumers will fail to request the new route of the new Provider. +2. If you forget to modify the microservice version number: some new Consumers will fail to request the route of the old Provider. +3. If you forget to configure the minimum dependent version of the Consumer: when the deployment order is to stop the Consumer first, then start the Consumer, then stop the Provider, and then start the Provider. The Consumer cannot obtain the new interface
[incubator-servicecomb-docs] 04/06: update java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 0995bb7acb3d0dc2575094328183af6d2c7caf56 Author: DeanLee AuthorDate: Mon Aug 20 11:54:24 2018 +0800 update java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md --- .../service-center-error-diagnosis.md | 49 +++--- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md b/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md index 4a02e06..89fed6d 100644 --- a/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md +++ b/java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md @@ -1,27 +1,27 @@ -开发者可以直接使用华为公有云提供的服务中心进行开发工作。使用服务中心,开发者需要注册华为云账号,并在"我的凭据”里面生成AK/SK信息用于访问认证控制。如何接入华为云的详细信息请参考“[华为公有云上部署](/start/deployment-on-cloud.md)”。 +Developers can directly use the service center provided by Huawei Public Cloud for development work. To use the service center, the developer needs to register the Huawei cloud account and generate AK/SK information in "My Credentials" for access to the authentication control. For details on how to access Huawei cloud, see "[Huawei Public Cloud Deployment] (/start/deployment-on-cloud.md)." -本章节重点介绍连接服务中心一些常见的异常及其排查方法。 +This chapter focuses on some common anomalies in the Connection Service Center and their Troubleshooting method. # \#1 -* 异常消息 +* Exception message {"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Invalid request, header is invalid, ak sk or project is empty."} -* 问题原因 +* Reason of problem -AK、SK没有正确设置和携带到请求头里面。 +AK, SK is not set correctly and carried into the request header. -* 排查方法 +* Troubleshooting method -检查项目中是否依赖如下认证模块。(间接依赖也是可以的,比如依赖cse-solution-service-engine\) +Check if the following authentication modules are used in the project. (Indirect dependencies are also possible, such as relying on cse-solution-service-engine\) ``` com.huawei.paas.cse foundation-auth ``` -检查microservice.yaml中的ak/sk配置是否正确,accessKey和secretKey是否填写错误,一般secretKey长度比accessKey长。 +Check if the ak/sk configuration in microservice.yaml is correct, whether the accessKey and secretKey are filled in incorrectly, and the length of the secretKey is longer than the accessKey. ``` servicecomb: @@ -31,39 +31,39 @@ servicecomb: akskCustomCipher: default ``` -可以登陆华为云,在“我的凭证”里面查询到accessKey信息,secretKey由用户自己保存,无法查询。如果忘记相关凭证,可以删除凭证信息,生成新的凭证信息。 +You can log in to Huawei Cloud and query the accessKey information in "My Credentials". The secretKey is saved by the user and cannot be queried. If you forget the relevant credentials, you can delete the voucher information and generate new voucher information. # \#2 -* 异常消息 +* Exception message {"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"validate ak sk error\"}"} -* 问题原因 +* Reason of problem -AK、SK不正确。 +AK, SK are not correct. -* 排查方法 +* Troubleshooting method -检查microservice.yaml中的ak/sk配置是否正确。可以登陆华为云,在“我的凭证”里面查询到accessKey信息,secretKey由用户自己保存,无法查询。如果忘记相关凭证,可以删除凭证信息,生成新的凭证信息。 +Check if the ak/sk configuration in microservice.yaml is correct. You can log in to Huawei Cloud and query the accessKey information in "My Credentials". The secretKey is saved by the user and cannot be queried. If you forget the relevant credentials, you can delete the voucher information and generate new voucher information. # \#3 -* 异常消息 +* Exception message {"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"get project token from iam failed. error:http post failed, statuscode: 400\"}"} -* 问题原因 +* Reason of problem -Project名称不正确。 +The Project name is incorrect. -* 排查方法 +* Troubleshooting method -检查配置项servicecomb.credentials.project的值是否正确,在“我的凭证”里面查询正确的Project名称。如果没有这个配置项,默认会根据服务中心的域名进行判断。当域名也不包含合法的Project名称的时候,需要增加这个配置项,保证其名称是“我的凭证”里面合法的Project名称。 +Check if the value of the configuration item servicecomb.credentials.project is correct, and query the correct Project name in "My Credentials". If there is no such configuration item, the default will be based on the domain name of the service center. When the domain name does not contain a legal Project name, you need to add this configuration item to ensure that its name is the legal Project name in "My Credentials". # \#4 -* 异常消息 +* Exception message {"errorCode":"41","errorMessage":"Invalid parameter\(s\)","detail":"Version validate failed, rule: {Length: 64,Length: ^\[a-zA-Z0-9\_ @@ -71,11 +71,10 @@ Project名称不正确。 "} -* 问题原因 +* Reason of problem -使用新版本SDK连接服务中心的老版本。 +Use the new version of the SDK to connect to an
[incubator-servicecomb-docs] 01/06: update components-for-spring-boot.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 8bba56585a98d0c6fa6cfc7e726de3715ffa73a5 Author: DeanLee AuthorDate: Mon Aug 20 11:17:39 2018 +0800 update components-for-spring-boot.md --- .../components-for-spring-boot.md | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/components-for-spring-boot.md b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/components-for-spring-boot.md index fb085df..32a287f 100644 --- a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/components-for-spring-boot.md +++ b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/components-for-spring-boot.md @@ -1,30 +1,29 @@ -针对Spring Boot、Spring Cloud,提供了如下几个组件: +For Spring Boot, Spring Cloud, the following components are provided: * spring-boot-starter-configuration -接入配置中心。当需要在Spring Boot、Spring Cloud应用中,使用配置中心作为动态配置管理工具的时候,需要依赖。 +Access the configuration center. When you need to use the Configuration Center as a dynamic configuration management tool in Spring Boot and Spring Cloud applications, you need dependence of them. * spring-boot-starter-registry -接入服务中心。当需要在Spring Boot、Spring Cloud应用中,使用服务中心作为服务注册、发现管理工具的时候,需要依赖。 +Access to the service center. When you need to use the service center as a service registration and discovery management tool in Spring Boot and Spring Cloud applications, you need dependence of them. * spring-boot-starter-discovery -适配Spring Cloud的DiscoveryClient接口。当在Spring Cloud中使用@EnableDiscoveryClient时,需要依赖。 +Adapt to the Spring Cloud's DiscoveryClient interface. When using @EnableDiscoveryClient in Spring Cloud, you need dependence of them. * spring-boot-starter-provider -在Spring Boot中通过@EnableServiceComb启用java chassis的核心功能。这个功能可以用于“JAVA应用方式”和”Web开发方式“。 在”Web开发方式”中,通过spring.main.web-environment=false禁用了Web环境。因此,这个模块主要是解决”JAVA应用方式“的问题。 +Enable the core functionality of java chassis via @EnableServiceComb in Spring Boot. This feature can be used for "JAVA application mode" and "Web development mode". In the "Web development method", the web environment is disabled by spring.main.web-environment=false. Therefore, this module is mainly to solve the problem of "JAVA application mode". * spring-boot-starter-transport -在Spring Boot中通过@EnableServiceComb启用java chassis的核心功能,并启用java chassis的RestServlet。用于” Web开发方式“。 - +Enable the core functionality of the java chassis via @EnableServiceComb in Spring Boot and enable the RestServlet for the java chassis. Used in "Web development mode". \ No newline at end of file
[incubator-servicecomb-docs] branch master updated (d49c546 -> b64ccd5)
This is an automated email from the ASF dual-hosted git repository. liubao pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git. from d49c546 modify table Regular expression new 8bba565 update components-for-spring-boot.md new 152f51f update java-chassis-reference/en_US/question-and-answer/interface-compatibility.md new f1754b7 update java-chassis-reference/en_US/question-and-answer/question_answer.md new 0995bb7 update java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md new 25a651c question-and-answer correct translation mistakes new b64ccd5 delete useless file question-and-answer service-center-error-diagnosis.md The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../question-and-answer/interface-compatibility.md | 42 +++--- .../en_US/question-and-answer/question_answer.md | 159 ++--- .../service-center-error-diagnosis.md | 81 --- .../components-for-spring-boot.md | 13 +- .../service-center-error-diagnosis.md | 81 --- 5 files changed, 105 insertions(+), 271 deletions(-) delete mode 100644 java-chassis-reference/en_US/question-and-answer/service-center-error-diagnosis.md delete mode 100644 java-chassis-reference/zh_CN/question-and-answer/service-center-error-diagnosis.md
[incubator-servicecomb-docs] 03/06: update java-chassis-reference/en_US/question-and-answer/question_answer.md
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit f1754b70f45ff1448aaf70531851c72f10cd0012 Author: DeanLee AuthorDate: Mon Aug 20 11:54:08 2018 +0800 update java-chassis-reference/en_US/question-and-answer/question_answer.md --- .../en_US/question-and-answer/question_answer.md | 159 ++--- 1 file changed, 79 insertions(+), 80 deletions(-) diff --git a/java-chassis-reference/en_US/question-and-answer/question_answer.md b/java-chassis-reference/en_US/question-and-answer/question_answer.md index 56ad8d8..20356ff 100644 --- a/java-chassis-reference/en_US/question-and-answer/question_answer.md +++ b/java-chassis-reference/en_US/question-and-answer/question_answer.md @@ -1,8 +1,8 @@ -# 问题描述:如何自定义某个Java方法对应的REST接口里的HTTP Status Code? +# Problem: How to customize the HTTP status code in the REST interface corresponding to a Java method? -** 解决方法:** +**Solution:** -对于正常的返回值,可以通过SwaggerAnnotation实现,例如: +For normal return values, this can be done with SwaggerAnnotation, for example: ```java @ApiResponse(code = 300, response = String.class, message = "") @@ -11,7 +11,7 @@ public int test(int x) { } ``` -对于异常的返回值,可以通过抛出自定义的InvocationException实现,例如:、 +For the return value of the exception, you can do this by throwing a custom InvocationException, for example: ```java public String testException(int code) { @@ -33,33 +33,32 @@ public int test(int x) { } ``` -# 问题描述: 如何定制自己微服务的日志配置 +# Problem: How to customize the log configuration of your own microservice -** 解决方法:** -ServiceComb不绑定日志器,只是使用了slf4j,用户可以自由选择log4j/log4j2/logback等等。ServiceComb提供了一个log4j的扩展,在标准log4j的基础上,支持log4j的properties文件的增量配置。 +** Solution:** +ServiceComb does not bind the logger, use slf4j, users can freely choose log4j/log4j2/logback and so on. +ServiceComb provides a log4j extension that supports incremental configuration of log4j's properties files on a standard log4j basis. -* 默认以规则:"classpath\*:config/log4j.properties"加载配置文件 -* 实际会搜索出classpath中所有的`config/log4j.properties和config/log4j.*.properties`, 从搜索出的文件中切出`\*`的部分,进行alpha排序,然后按顺序加载,最后合成的文件作为log4j的配置文件。 -* 如果要使用ServiceComb的log4j扩展,则需要调用Log4jUtils.init,否则完全按标准的日志器的规则使用。 +* By default, the configuration file is loaded from the path: "classpath\*:config/log4j.properties" +* It will actually search all the `config/log4j.properties and config/log4j.*.properties` in the classpath, cut out the `\*` part from the searched file, sort the alpha, then load it in order, and finally compose The file is used as the log4j configuration file. +* If you want to use ServiceComb's log4j extension, you need to call Log4jUtils.init, otherwise it will be used according to the rules of the standard logger. -# 问题描述: 当服务配置了多个transport的时候,在运行时是怎么选择使用哪个transport的? +# Problem: When the service is configured with multiple transports, how do you choose which transport to use at runtime? -** 解决方法:** +** Solution:** -* ServiceComb的consumer、transport、handler、producer之间是解耦的,各功能之间通过契约定义联合在一起工作的,即: - consumer使用透明rpc,还是springmvc开发与使用highway,还是RESTful在网络上传输没有关系与producer是使用透明rpc,还是jaxrs,或者是springmvc开发,也没有关系handler也不感知,业务开发方式以及传输方式 +* ServiceComb's consumer, transport, handler, and producer are decoupled. The functions work together through contract definitions, that is, whether the consumer uses transparent rpc, or springmvc develops and uses a highway, or RESTful does not transmit on the network. Relationships and producers use transparent rpc, or jaxrs, or springmvc development, and there is no relationship between the receiver and the perception, business development methods and transmission methods. -* consumer访问producer,在运行时的transport选择上,总规则为: - consumer的transport与producer的endpoint取交集,如果交集后,还有多个transport可选择,则轮流使用 +* Consumer access producer, in the runtime transport selection, the general rule is: the consumer's transport and producer's endpoint intersection, if there are multiple transports after the intersection, then use in turn -分解开来,存在以下场景: +Decomposed, there are the following scenarios: -* 当一个微服务producer同时开放了highway以及RESTful的endpoint - * consumer进程中只部署了highway transport jar,则只会访问producer的highway endpoint - * consumer进程中只部署了RESTful transport jar,则只会访问producer的RESTful endpoint - * consumer进程中,同时部署了highway和RESTful transport jar,则会轮流访问producer的highway、RESTful endpoint +* When a microservice producer opens both the highway and the RESTful endpoint + * Only the highway transport jar is deployed in the consumer process, only the producer's highway endpoint is accessed. + * Only the RESTful transport jar is deployed in the consumer process, only the RESTful endpoint of the producer is accessed. + * The consumer process, while deploying the highway and RESTful transport jar, will take turns accessing the producer's highway, RESTful endpoint
[incubator-servicecomb-docs] 05/06: question-and-answer correct translation mistakes
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit 25a651cb10856d75a149293978c9480d8019c1a1 Author: DeanLee AuthorDate: Tue Aug 21 12:34:18 2018 +0800 question-and-answer correct translation mistakes --- .../en_US/question-and-answer/question_answer.md | 20 ++-- .../components-for-spring-boot.md| 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/java-chassis-reference/en_US/question-and-answer/question_answer.md b/java-chassis-reference/en_US/question-and-answer/question_answer.md index 20356ff..32c66ce 100644 --- a/java-chassis-reference/en_US/question-and-answer/question_answer.md +++ b/java-chassis-reference/en_US/question-and-answer/question_answer.md @@ -43,7 +43,7 @@ ServiceComb provides a log4j extension that supports incremental configuration o * It will actually search all the `config/log4j.properties and config/log4j.*.properties` in the classpath, cut out the `\*` part from the searched file, sort the alpha, then load it in order, and finally compose The file is used as the log4j configuration file. * If you want to use ServiceComb's log4j extension, you need to call Log4jUtils.init, otherwise it will be used according to the rules of the standard logger. -# Problem: When the service is configured with multiple transports, how do you choose which transport to use at runtime? +# Problem: When the service is configured with multiple types of transport, What are the mechanisms for ServiceComb choose which transport to use at runtime? ** Solution:** @@ -53,7 +53,7 @@ ServiceComb provides a log4j extension that supports incremental configuration o Decomposed, there are the following scenarios: -* When a microservice producer opens both the highway and the RESTful endpoint +* When a microservice producer provided both the highway and the RESTful endpoint * Only the highway transport jar is deployed in the consumer process, only the producer's highway endpoint is accessed. * Only the RESTful transport jar is deployed in the consumer process, only the RESTful endpoint of the producer is accessed. * The consumer process, while deploying the highway and RESTful transport jar, will take turns accessing the producer's highway, RESTful endpoint @@ -67,13 +67,13 @@ servicecomb: transport: highway ``` -* When a microservice producer only opens the endpoint of the highway +* When a microservice producer only provided the endpoint of the highway - * The consumer process only deploys the highway transport jar, and normally uses higway access. + * The consumer process only deploys the highway transport jar, and normally uses higway endpoint. * The consumer process can only be accessed if only the RESTful transport jar is deployed * The consumer process deploys both the highway and the RESTful transport jar, and the highway access is normally used. -* When a microservice producer only opens RESTful endpoints +* When a microservice producer only provided RESTful endpoints * The consumer process only deploys the highway transport jar and cannot access it. * The consumer process only deploys RESTful transport jars, which normally use RESTful access @@ -143,13 +143,13 @@ When defining the type of the body parameter, you can't use type directly instea $ref: "#/definitions/ReponseImpl" ``` -# Problem: Does the microservices framework service call use long connections? +# Problem: Does the microservices framework service call use long live connection? ** Solution:** Http uses a long connection (with a timeout), and the highway mode uses a long connection (always on). -# Problem: Whether the service disconnection service's center registration information is automatically deleted +# Problem: When the service is disconnected from the service center, will the registration information be deleted automatically? ** Solution:** @@ -164,7 +164,7 @@ Transmitting data into: ```java CseHttpEntity httpEntity = new CseHttpEntity<>(xxx); -//Transparent content +//Transmission content httpEntity.addContext("contextKey","contextValue"); ResponseEntity responseEntity = RestTemplateBuilder.create().exchange("cse://springmvc/springmvchello/sayhello",HttpMethod.POST,httpEntity,String.class); ``` @@ -245,7 +245,7 @@ servicecomb: timeout: 3 ``` -# Problem: Is there a requirement for the processing chain of service governance? +# Problem: Is there a required for the processing chain's sequence of service governance? **Solution:** @@ -271,4 +271,4 @@ Consumer: loadbalance, tracing-consumer, sla-consumer, bizkeeper-consumer Provider: tracing-provider, sla-provider, bizkeeper-provider -This order is sufficient for most scenarios and is not prone to incomprehensible errors. \ No newline at end
[GitHub] liubao68 closed pull request #35: modify table Regular expression
liubao68 closed pull request #35: modify table Regular expression URL: https://github.com/apache/incubator-servicecomb-docs/pull/35 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/java-chassis-reference/en_US/build-provider/definition/service-definition.md b/java-chassis-reference/en_US/build-provider/definition/service-definition.md index 82da8b3..c7108f6 100644 --- a/java-chassis-reference/en_US/build-provider/definition/service-definition.md +++ b/java-chassis-reference/en_US/build-provider/definition/service-definition.md @@ -15,7 +15,7 @@ | 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | | :--- | :--- | :--- | :--- | :--- | :--- | | APPLICATION\_ID | - | - | 是 | 应用名 | - | -| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$\|^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | +| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | | service\_description.version | - | - | 是 | 微服务版本号 | - | | service\_description.description | - | - | 否 | 微服务描述 | | | service\_description.properties | - | - | 否 | 微服务元数据配置(通过microservice.yaml文件进行配置) | - | diff --git a/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md b/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md index 82da8b3..c7108f6 100644 --- a/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md +++ b/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md @@ -15,7 +15,7 @@ | 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | | :--- | :--- | :--- | :--- | :--- | :--- | | APPLICATION\_ID | - | - | 是 | 应用名 | - | -| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$\|^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | +| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | | service\_description.version | - | - | 是 | 微服务版本号 | - | | service\_description.description | - | - | 否 | 微服务描述 | | | service\_description.properties | - | - | 否 | 微服务元数据配置(通过microservice.yaml文件进行配置) | - | This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[incubator-servicecomb-docs] branch master updated: modify table Regular expression
This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git The following commit(s) were added to refs/heads/master by this push: new d49c546 modify table Regular expression d49c546 is described below commit d49c5463a9ac637c75d3182c878b866b2016640a Author: weichao666 AuthorDate: Mon Aug 20 11:01:48 2018 +0800 modify table Regular expression --- .../en_US/build-provider/definition/service-definition.md | 2 +- .../zh_CN/build-provider/definition/service-definition.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java-chassis-reference/en_US/build-provider/definition/service-definition.md b/java-chassis-reference/en_US/build-provider/definition/service-definition.md index 82da8b3..c7108f6 100644 --- a/java-chassis-reference/en_US/build-provider/definition/service-definition.md +++ b/java-chassis-reference/en_US/build-provider/definition/service-definition.md @@ -15,7 +15,7 @@ | 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | | :--- | :--- | :--- | :--- | :--- | :--- | | APPLICATION\_ID | - | - | 是 | 应用名 | - | -| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$\|^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | +| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | | service\_description.version | - | - | 是 | 微服务版本号 | - | | service\_description.description | - | - | 否 | 微服务描述 | | | service\_description.properties | - | - | 否 | 微服务元数据配置(通过microservice.yaml文件进行配置) | - | diff --git a/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md b/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md index 82da8b3..c7108f6 100644 --- a/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md +++ b/java-chassis-reference/zh_CN/build-provider/definition/service-definition.md @@ -15,7 +15,7 @@ | 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 | | :--- | :--- | :--- | :--- | :--- | :--- | | APPLICATION\_ID | - | - | 是 | 应用名 | - | -| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$\|^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | +| service\_description.name | - | - | 是 | 微服务名 | 应确保app内部唯一。微服务名支持数字、大小写字母和"-"、"\_"、"."三个特殊字符,但是不能以特殊字符作为首尾字符,命名规范为:^\[a-zA-Z0-9\]+$^\[a-zA-Z0-9\]\[a-zA-Z0-9\_-.\]\*\[a-zA-Z0-9\]$。 | | service\_description.version | - | - | 是 | 微服务版本号 | - | | service\_description.description | - | - | 否 | 微服务描述 | | | service\_description.properties | - | - | 否 | 微服务元数据配置(通过microservice.yaml文件进行配置) | - |
[incubator-servicecomb-docs] branch master updated (82d911d -> dd13fde)
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git. from 82d911d 1. 补充错误处理文档。 2 将中英文的内容目录内容刷新到一致状态,方便翻译。 * [异常处理](general-development/error-handling.md) 中英文 add 5965f85 update .travis.yml for saga and sc add 12f0d65 fix path issue of .travis.yml new dd13fde Merge pull request #36 from imlidian/master The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
[incubator-servicecomb-docs] 01/01: Merge pull request #36 from imlidian/master
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-docs.git commit dd13fde0004704f7c193cc22fb6a3ee3b7e16259 Merge: 82d911d 12f0d65 Author: Willem Jiang AuthorDate: Tue Aug 21 16:13:18 2018 +0800 Merge pull request #36 from imlidian/master update .travis.yml for saga and sc .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
[GitHub] WillemJiang closed pull request #36: update .travis.yml for saga and sc
WillemJiang closed pull request #36: update .travis.yml for saga and sc URL: https://github.com/apache/incubator-servicecomb-docs/pull/36 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.travis.yml b/.travis.yml index 4513c9f..96cf703 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ script: - npm install gitbook-cli -g - - gitbook build java-chassis-reference docs + - gitbook build java-chassis-reference docs/java-chassis + - gitbook build saga-reference docs/saga + - gitbook build service-center-reference docs/service-center - git clone --depth=10 --branch=master https://$PUSH_TARGET_URL servicecomb-java-chassis-doc after_success: - cp -r docs/ servicecomb-java-chassis-doc/ This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on issue #258: [SCB-855]Support JDK7 in saga-format
WillemJiang commented on issue #258: [SCB-855]Support JDK7 in saga-format URL: https://github.com/apache/incubator-servicecomb-saga/pull/258#issuecomment-414567727 Please add JIRA number on your commit log, otherwise I had to use the squash to merge your change. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #258: [SCB-855]Support JDK7 in saga-format
WillemJiang commented on a change in pull request #258: [SCB-855]Support JDK7 in saga-format URL: https://github.com/apache/incubator-servicecomb-saga/pull/258#discussion_r211493762 ## File path: saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java ## @@ -166,36 +195,37 @@ public void setUp() throws Exception { .thenReturn(response11); when(restTransport.with("aaa", "/rest/as", "delete", singletonMap("query", singletonMap("bar", "as" .thenReturn(response12); -when(restTransport.with("aaa", "/rest/as", "put", emptyMap())) +when(restTransport.with("aaa", "/rest/as", "put", Collections.>emptyMap())) Review comment: We could extract an empty map constant here. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] KomachiSion opened a new pull request #258: [SCB-855]Support JDK7 in saga-format
KomachiSion opened a new pull request #258: [SCB-855]Support JDK7 in saga-format URL: https://github.com/apache/incubator-servicecomb-saga/pull/258 Rewrite the lamda function in saga-format to support JDK 7 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #36: update .travis.yml for saga and sc
WillemJiang commented on a change in pull request #36: update .travis.yml for saga and sc URL: https://github.com/apache/incubator-servicecomb-docs/pull/36#discussion_r211490270 ## File path: .travis.yml ## @@ -1,6 +1,8 @@ script: - npm install gitbook-cli -g - gitbook build java-chassis-reference docs Review comment: gitbook build java-chassis-reference docs/java-chassis This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] WillemJiang commented on a change in pull request #38: update Packaging dir translation
WillemJiang commented on a change in pull request #38: update Packaging dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/38#discussion_r211490087 ## File path: java-chassis-reference/en_US/packaging/web-container.md ## @@ -1,6 +1,6 @@ ## Concept Description -If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you can not write or write a small amount of boot code as needed. +If you need to load the microservice into the web container to start the runtime, you need to create a new servlet project wrapper, the servlet project, you just need write few lines of code Review comment: just need to write This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services