[GitHub] coveralls edited a comment on issue #265: SCB-865 Implement reaction of the event in Alpha Server
coveralls edited a comment on issue #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#issuecomment-415079111 [![Coverage Status](https://coveralls.io/builds/18624562/badge)](https://coveralls.io/builds/18624562) Coverage decreased (-2.9%) to 87.969% when pulling **9dc004925d42f9f688eb867e92adb2812c70bc8a on cherrylzhao:master** into **0ee4c59169224e9a2f4ab76f44216a2784df02bd 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] cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212173581 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/TccCoordinateCommandStreamObserver.java ## @@ -0,0 +1,52 @@ +/* + * 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.common; + +import io.grpc.stub.StreamObserver; +import java.util.Queue; +import java.util.function.Consumer; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand; + +public class TccCoordinateCommandStreamObserver implements StreamObserver { + + private static Queue receivedCommands; + private Consumer consumer; + private boolean completed = false; + + public TccCoordinateCommandStreamObserver(Consumer consumer, + Queue receivedCommands) { +this.consumer = consumer; +TccCoordinateCommandStreamObserver.receivedCommands = receivedCommands; + } + + @Override + public void onNext(GrpcTccCoordinateCommand value) { +consumer.accept(value); +receivedCommands.add(value); + } + + @Override + public void onError(Throwable t) { + Review comment: this is Junit test class, receivedCommands simulate omega receive the coordinateCommand. 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 commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212173346 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/event/ParticipatedEvent.java ## @@ -0,0 +1,113 @@ +/* + * 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 ParticipatedEvent { Review comment: GrpcParticipatedEvent is probuf message, it is not convenient for us to handle backend process (eg. data persistence (reds or database) 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 commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212172236 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/GrpcTccServerConfig.java ## @@ -0,0 +1,75 @@ +/* + * 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.common; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class GrpcTccServerConfig { Review comment: now saga server logic can't share with tcc server, so I create a independent cofiguration file 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 commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212170498 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/GrpcBootstrap.java ## @@ -0,0 +1,109 @@ +/* + * 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.common; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.netty.GrpcSslContexts; +import io.grpc.netty.NettyServerBuilder; +import io.netty.handler.ssl.ClientAuth; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.SslProvider; +import java.io.IOException; +import java.io.InputStream; +import java.lang.invoke.MethodHandles; +import java.net.InetSocketAddress; +import java.util.Arrays; +import java.util.Properties; +import javax.net.ssl.SSLException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GrpcBootstrap implements Bootstrap { Review comment: now I don't want update the saga server code. 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 commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212170361 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/GrpcBootstrap.java ## @@ -0,0 +1,109 @@ +/* + * 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.common; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.netty.GrpcSslContexts; +import io.grpc.netty.NettyServerBuilder; +import io.netty.handler.ssl.ClientAuth; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.SslProvider; +import java.io.IOException; +import java.io.InputStream; +import java.lang.invoke.MethodHandles; +import java.net.InetSocketAddress; +import java.util.Arrays; +import java.util.Properties; +import javax.net.ssl.SSLException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GrpcBootstrap implements Bootstrap { Review comment: I can't reference it for saga server class (GrpcStartable) is not public, so I create a GrpcBootstrap in test package 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 commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212170013 ## File path: 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.ParticipatedEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun Review comment: let me revise 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] cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server
cherrylzhao commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212169922 ## File path: 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.ParticipatedEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun Review comment: ok 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 closed pull request #423: SCB-857 Provider rule of consumer can not be removed
little-cui closed pull request #423: SCB-857 Provider rule of consumer can not be removed URL: https://github.com/apache/incubator-servicecomb-service-center/pull/423 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/docs/README.md b/docs/README.md index eb144af0..ba6aef1a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,7 +22,7 @@ - [In Kubernetes Cluster](/integration/k8s) -- [In VM](/docs/sc-cluster.md) +- [In VMs](/docs/sc-cluster.md) - [Deploy with TLS](/docs/security-tls.md) diff --git a/integration/k8s/service-center/charts/etcd/charts/etcd-operator/.helmignore b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/.helmignore new file mode 100644 index ..f0c13194 --- /dev/null +++ b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/integration/k8s/service-center/charts/etcd/charts/etcd-operator/Chart.yaml b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/Chart.yaml new file mode 100644 index ..36f89243 --- /dev/null +++ b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +appVersion: 0.9.2 +description: CoreOS etcd-operator Helm chart for Kubernetes +home: https://github.com/coreos/etcd-operator +icon: https://raw.githubusercontent.com/coreos/etcd/master/logos/etcd-horizontal-color.png +maintainers: +- email: chance.zibol...@coreos.com + name: chancez +- email: lach...@deis.com + name: lachie83 +- email: jaescobar.c...@gmail.com + name: alejandroEsc +name: etcd-operator +sources: +- https://github.com/coreos/etcd-operator +version: 0.8.0 diff --git a/integration/k8s/service-center/charts/etcd/charts/etcd-operator/OWNERS b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/OWNERS new file mode 100644 index ..e7cf8709 --- /dev/null +++ b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/OWNERS @@ -0,0 +1,8 @@ +approvers: +- lachie83 +- chancez +- alejandroEsc +reviewers: +- lachie83 +- chancez +- alejandroEsc diff --git a/integration/k8s/service-center/charts/etcd/charts/etcd-operator/README.md b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/README.md new file mode 100644 index ..746d73d7 --- /dev/null +++ b/integration/k8s/service-center/charts/etcd/charts/etcd-operator/README.md @@ -0,0 +1,158 @@ +# CoreOS etcd-operator + +[etcd-operator](https://coreos.com/blog/introducing-the-etcd-operator.html) Simplify etcd cluster +configuration and management. + +__DISCLAIMER:__ While this chart has been well-tested, the etcd-operator is still currently in beta. +Current project status is available [here](https://github.com/coreos/etcd-operator). + +## Introduction + +This chart bootstraps an etcd-operator and allows the deployment of etcd-cluster(s). + +## Official Documentation + +Official project documentation found [here](https://github.com/coreos/etcd-operator) + +## Prerequisites + +- Kubernetes 1.4+ with Beta APIs enabled +- __Suggested:__ PV provisioner support in the underlying infrastructure to support backups + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +$ helm install stable/etcd-operator --name my-release +``` + +__Note__: If you set `cluster.enabled` on install, it will have no effect. +Before you create an etcd cluster, the TPR must be installed by the operator, so this option is ignored during helm installs, but can be used in upgrades. + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +$ helm delete my-release +``` + +The command removes all the Kubernetes components EXCEPT the persistent volume. + +## Updating +Updating the TPR resource will not result in the cluster being update until `kubectl apply` for +TPRs is fixed see [kubernetes/issues/29542](https://github.com/kubernetes/kubernetes/issues/29542) +Work around options are documented [here](https://github.com/coreos/etcd-operator#resize-an-etcd-cluster) + +## Configuration + +The following table lists the configurable parameters of the etcd-operator chart and their default values. + +| Parameter | Description | Default | +|
[incubator-servicecomb-service-center] branch master updated: Docker hub 中的service center 镜像说明需要优化 (#427)
This is an automated email from the ASF dual-hosted git repository. littlecui pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new ed50817 Docker hub 中的service center 镜像说明需要优化 (#427) ed50817 is described below commit ed50817600d4fcbf7b3fb08bb18ee83a7ef74cbc Author: little-cui AuthorDate: Thu Aug 23 09:55:21 2018 +0800 Docker hub 中的service center 镜像说明需要优化 (#427) --- docker-compose.yml | 2 +- integration/docker/docker-compose.yml| 2 +- integration/k8s/service-center/templates/deployment.yaml | 2 +- scripts/docker/build-frontend-image/README.md| 4 ++-- scripts/docker/build-frontend-image/start.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6a9ec64..9a9a01d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,4 +30,4 @@ services: ports: - "30103:30103" environment: - BACKEND_ADDRESS: http://service-center:30100 + SC_ADDRESS: http://service-center:30100 diff --git a/integration/docker/docker-compose.yml b/integration/docker/docker-compose.yml index 6fd50b7..964837e 100644 --- a/integration/docker/docker-compose.yml +++ b/integration/docker/docker-compose.yml @@ -48,6 +48,6 @@ services: ports: - "30103:30103" environment: - BACKEND_ADDRESS: http://service-center:30100 + SC_ADDRESS: http://service-center:30100 volumes: grafana_data: diff --git a/integration/k8s/service-center/templates/deployment.yaml b/integration/k8s/service-center/templates/deployment.yaml index d253799..f1ca9cf 100644 --- a/integration/k8s/service-center/templates/deployment.yaml +++ b/integration/k8s/service-center/templates/deployment.yaml @@ -67,7 +67,7 @@ spec: ports: - containerPort: {{ .Values.frontend.service.internalPort }} env: - - name: BACKEND_ADDRESS + - name: SC_ADDRESS value: http://{{ $serviceName }}:{{ $servicePort }} livenessProbe: httpGet: diff --git a/scripts/docker/build-frontend-image/README.md b/scripts/docker/build-frontend-image/README.md index 532ddaf..144ceae 100644 --- a/scripts/docker/build-frontend-image/README.md +++ b/scripts/docker/build-frontend-image/README.md @@ -12,11 +12,11 @@ Then build docker image of frontend from folder "PROJECT_ROOT/scripts/docker/bui Once the script finishes you will see image scfrontend-dev.tgz in the same directory. You can use this this image to load the docker and start using. Run following command, open Web Browser and connect to URL "http://:30103" to view frontend UI. -docker run -d -p 30103:30103 -e BACKEND_ADDRESS=${BACKEND_ADDRESS} -t servicecomb/scfrontend +docker run -d -p 30103:30103 -e SC_ADDRESS=${SC_ADDRESS} -t servicecomb/scfrontend Where HOST_IP is the ip of host machine where docker container for frontend is executing. Note: 1. The same image can be used to deploy in Huawei Public Cloud using CFE/CCE or just deploy in a VM. -1. Configuring BACKEND_ADDRESS will enable you to setup the EIP of the Service-center. +1. Configuring SC_ADDRESS will enable you to setup the EIP of the service-center. diff --git a/scripts/docker/build-frontend-image/start.sh b/scripts/docker/build-frontend-image/start.sh index 3163dd0..b634a39 100644 --- a/scripts/docker/build-frontend-image/start.sh +++ b/scripts/docker/build-frontend-image/start.sh @@ -23,7 +23,7 @@ cd /opt/frontend sed -i "s/^frontend_host_ip.*=.*$/frontend_host_ip = $(hostname)/g" conf/app.conf -sc_ip_port=${BACKEND_ADDRESS#*//} +sc_ip_port=${SC_ADDRESS#*//} sc_ip=${sc_ip_port%:*} sc_port=${sc_ip_port#*:}
[GitHub] little-cui closed pull request #427: SCB-862 Using different environment variables in image
little-cui closed pull request #427: SCB-862 Using different environment variables in image URL: https://github.com/apache/incubator-servicecomb-service-center/pull/427 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/docker-compose.yml b/docker-compose.yml index 6a9ec642..9a9a01dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,4 +30,4 @@ services: ports: - "30103:30103" environment: - BACKEND_ADDRESS: http://service-center:30100 + SC_ADDRESS: http://service-center:30100 diff --git a/integration/docker/docker-compose.yml b/integration/docker/docker-compose.yml index 6fd50b74..964837ef 100644 --- a/integration/docker/docker-compose.yml +++ b/integration/docker/docker-compose.yml @@ -48,6 +48,6 @@ services: ports: - "30103:30103" environment: - BACKEND_ADDRESS: http://service-center:30100 + SC_ADDRESS: http://service-center:30100 volumes: grafana_data: diff --git a/integration/k8s/service-center/templates/deployment.yaml b/integration/k8s/service-center/templates/deployment.yaml index d2537994..f1ca9cf3 100644 --- a/integration/k8s/service-center/templates/deployment.yaml +++ b/integration/k8s/service-center/templates/deployment.yaml @@ -67,7 +67,7 @@ spec: ports: - containerPort: {{ .Values.frontend.service.internalPort }} env: - - name: BACKEND_ADDRESS + - name: SC_ADDRESS value: http://{{ $serviceName }}:{{ $servicePort }} livenessProbe: httpGet: diff --git a/scripts/docker/build-frontend-image/README.md b/scripts/docker/build-frontend-image/README.md index 532ddaff..144ceaee 100644 --- a/scripts/docker/build-frontend-image/README.md +++ b/scripts/docker/build-frontend-image/README.md @@ -12,11 +12,11 @@ Then build docker image of frontend from folder "PROJECT_ROOT/scripts/docker/bui Once the script finishes you will see image scfrontend-dev.tgz in the same directory. You can use this this image to load the docker and start using. Run following command, open Web Browser and connect to URL "http://:30103" to view frontend UI. -docker run -d -p 30103:30103 -e BACKEND_ADDRESS=${BACKEND_ADDRESS} -t servicecomb/scfrontend +docker run -d -p 30103:30103 -e SC_ADDRESS=${SC_ADDRESS} -t servicecomb/scfrontend Where HOST_IP is the ip of host machine where docker container for frontend is executing. Note: 1. The same image can be used to deploy in Huawei Public Cloud using CFE/CCE or just deploy in a VM. -1. Configuring BACKEND_ADDRESS will enable you to setup the EIP of the Service-center. +1. Configuring SC_ADDRESS will enable you to setup the EIP of the service-center. diff --git a/scripts/docker/build-frontend-image/start.sh b/scripts/docker/build-frontend-image/start.sh index 3163dd00..b634a392 100644 --- a/scripts/docker/build-frontend-image/start.sh +++ b/scripts/docker/build-frontend-image/start.sh @@ -23,7 +23,7 @@ cd /opt/frontend sed -i "s/^frontend_host_ip.*=.*$/frontend_host_ip = $(hostname)/g" conf/app.conf -sc_ip_port=${BACKEND_ADDRESS#*//} +sc_ip_port=${SC_ADDRESS#*//} sc_ip=${sc_ip_port%:*} sc_port=${sc_ip_port#*:} 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-service-center] branch master updated: build script for docker image gives an error (#426)
This is an automated email from the ASF dual-hosted git repository. littlecui pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new 6b2966f build script for docker image gives an error (#426) 6b2966f is described below commit 6b2966f32831267eefadf4ab9b67ca78deecb8ca Author: little-cui AuthorDate: Thu Aug 23 09:55:00 2018 +0800 build script for docker image gives an error (#426) --- scripts/build/tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/tools.sh b/scripts/build/tools.sh index dbf609d..325b35d 100644 --- a/scripts/build/tools.sh +++ b/scripts/build/tools.sh @@ -93,7 +93,7 @@ frontend_deps() { ## Download the frontend dependencies using bower cd frontend/app -bower install +bower install --allow-root cd ../.. }
[GitHub] little-cui closed pull request #426: SCB-863 build script for docker image gives an error
little-cui closed pull request #426: SCB-863 build script for docker image gives an error URL: https://github.com/apache/incubator-servicecomb-service-center/pull/426 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/scripts/build/tools.sh b/scripts/build/tools.sh index dbf609d1..325b35de 100644 --- a/scripts/build/tools.sh +++ b/scripts/build/tools.sh @@ -93,7 +93,7 @@ frontend_deps() { ## Download the frontend dependencies using bower cd frontend/app -bower install +bower install --allow-root cd ../.. } 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 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api
yhs0092 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882#discussion_r212158390 ## File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiProcessor.java ## @@ -17,18 +17,69 @@ package org.apache.servicecomb.swagger.generator.core.processor.annotation; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.servicecomb.swagger.generator.core.ClassAnnotationProcessor; import org.apache.servicecomb.swagger.generator.core.SwaggerGenerator; import org.springframework.util.StringUtils; import io.swagger.annotations.Api; +import io.swagger.models.Swagger; public class ApiProcessor implements ClassAnnotationProcessor { @Override public void process(Object annotation, SwaggerGenerator swaggerGenerator) { Api api = (Api) annotation; setTags(api, swaggerGenerator); +// except for @Api, @RequestMapping can also set consumes and produces +// @RequestMapping takes HIGHER priority than @Api for legacy reason +processConsumes(api, swaggerGenerator.getSwagger()); +processProduces(api, swaggerGenerator.getSwagger()); + } + + private void processProduces(Api api, Swagger swagger) { +List validProducesList = getValidStringList(api.produces()); +if (isBlank(swagger.getProduces()) && !validProducesList.isEmpty()) { + swagger.setProduces(validProducesList); +} + } + + private void processConsumes(Api api, Swagger swagger) { +List validConsumesList = getValidStringList(api.consumes()); +if (isBlank(swagger.getConsumes()) && !validConsumesList.isEmpty()) { + swagger.setConsumes(validConsumesList); +} + } + + /** + * Split {@link Api#consumes} and {@link Api#produces}, and filter empty items. + */ + private List getValidStringList(String rawString) { +return Stream.of(rawString.split(",")) +.filter(s -> !StringUtils.isEmpty(s)) +.map(String::trim) +.collect(Collectors.toList()); + } + + /** + * @return true if {@code stringList} is empty or each element of {@code stringList} is empty; + * otherwise false. + */ + private boolean isBlank(List stringList) { +boolean isEmpty = null == stringList || stringList.isEmpty(); +if (isEmpty) { + return true; +} + +for (String s : stringList) { + if (StringUtils.isEmpty(s)) { Review comment: Yes, except that users set blank string into it directly. Should we consider such situation? 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 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api
yhs0092 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882#discussion_r212157243 ## File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiProcessor.java ## @@ -17,18 +17,69 @@ package org.apache.servicecomb.swagger.generator.core.processor.annotation; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.servicecomb.swagger.generator.core.ClassAnnotationProcessor; import org.apache.servicecomb.swagger.generator.core.SwaggerGenerator; import org.springframework.util.StringUtils; import io.swagger.annotations.Api; +import io.swagger.models.Swagger; public class ApiProcessor implements ClassAnnotationProcessor { @Override public void process(Object annotation, SwaggerGenerator swaggerGenerator) { Api api = (Api) annotation; setTags(api, swaggerGenerator); +// except for @Api, @RequestMapping can also set consumes and produces +// @RequestMapping takes HIGHER priority than @Api for legacy reason +processConsumes(api, swaggerGenerator.getSwagger()); Review comment: Both `Api` and `RequestMapping` can set consumes and produces but their processors' behavior is different. `ApiProcessor` only set consumes/produces when there is no config in Swagger, but `RequestMappingClassAnnotationProcessor` will set consumes/produces no matter there is config in Swagger. In other words, `ApiProcessor` cannot over write the config but `RequestMappingClassAnnotationProcessor` can. So `RequestMapping` takes higher priority. 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 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api
liubao68 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882#discussion_r212156900 ## File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiProcessor.java ## @@ -17,18 +17,69 @@ package org.apache.servicecomb.swagger.generator.core.processor.annotation; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.servicecomb.swagger.generator.core.ClassAnnotationProcessor; import org.apache.servicecomb.swagger.generator.core.SwaggerGenerator; import org.springframework.util.StringUtils; import io.swagger.annotations.Api; +import io.swagger.models.Swagger; Review comment: Can you add an integration test for this feature? 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 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api
liubao68 commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882#discussion_r212156567 ## File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiProcessor.java ## @@ -17,18 +17,69 @@ package org.apache.servicecomb.swagger.generator.core.processor.annotation; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.servicecomb.swagger.generator.core.ClassAnnotationProcessor; import org.apache.servicecomb.swagger.generator.core.SwaggerGenerator; import org.springframework.util.StringUtils; import io.swagger.annotations.Api; +import io.swagger.models.Swagger; public class ApiProcessor implements ClassAnnotationProcessor { @Override public void process(Object annotation, SwaggerGenerator swaggerGenerator) { Api api = (Api) annotation; setTags(api, swaggerGenerator); +// except for @Api, @RequestMapping can also set consumes and produces +// @RequestMapping takes HIGHER priority than @Api for legacy reason +processConsumes(api, swaggerGenerator.getSwagger()); +processProduces(api, swaggerGenerator.getSwagger()); + } + + private void processProduces(Api api, Swagger swagger) { +List validProducesList = getValidStringList(api.produces()); +if (isBlank(swagger.getProduces()) && !validProducesList.isEmpty()) { + swagger.setProduces(validProducesList); +} + } + + private void processConsumes(Api api, Swagger swagger) { +List validConsumesList = getValidStringList(api.consumes()); +if (isBlank(swagger.getConsumes()) && !validConsumesList.isEmpty()) { + swagger.setConsumes(validConsumesList); +} + } + + /** + * Split {@link Api#consumes} and {@link Api#produces}, and filter empty items. + */ + private List getValidStringList(String rawString) { +return Stream.of(rawString.split(",")) +.filter(s -> !StringUtils.isEmpty(s)) +.map(String::trim) +.collect(Collectors.toList()); + } + + /** + * @return true if {@code stringList} is empty or each element of {@code stringList} is empty; + * otherwise false. + */ + private boolean isBlank(List stringList) { +boolean isEmpty = null == stringList || stringList.isEmpty(); +if (isEmpty) { + return true; +} + +for (String s : stringList) { + if (StringUtils.isEmpty(s)) { Review comment: seems s can never be empty 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on issue #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#issuecomment-415231190 We need update the unit test, as the code coverage is dropped a lot. 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212143642 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/event/ParticipatedEvent.java ## @@ -0,0 +1,113 @@ +/* + * 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 ParticipatedEvent { Review comment: I don't think we need this event in alpha server, as we can use the grpc generated Event directly. 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212143410 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/TccCoordinateCommandStreamObserver.java ## @@ -0,0 +1,52 @@ +/* + * 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.common; + +import io.grpc.stub.StreamObserver; +import java.util.Queue; +import java.util.function.Consumer; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand; + +public class TccCoordinateCommandStreamObserver implements StreamObserver { + + private static Queue receivedCommands; + private Consumer consumer; + private boolean completed = false; + + public TccCoordinateCommandStreamObserver(Consumer consumer, + Queue receivedCommands) { +this.consumer = consumer; +TccCoordinateCommandStreamObserver.receivedCommands = receivedCommands; + } + + @Override + public void onNext(GrpcTccCoordinateCommand value) { +consumer.accept(value); +receivedCommands.add(value); + } + + @Override + public void onError(Throwable t) { + Review comment: The error means there is something wrong when sending the CoordinateCommand back to Omega. what's the purpose of receivedCommands? 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212142810 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/GrpcTccServerConfig.java ## @@ -0,0 +1,75 @@ +/* + * 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.common; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class GrpcTccServerConfig { Review comment: we should share the configuration of saga alpha server. 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212142662 ## File path: alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/common/GrpcBootstrap.java ## @@ -0,0 +1,109 @@ +/* + * 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.common; + +import io.grpc.BindableService; +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.grpc.netty.GrpcSslContexts; +import io.grpc.netty.NettyServerBuilder; +import io.netty.handler.ssl.ClientAuth; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.SslProvider; +import java.io.IOException; +import java.io.InputStream; +import java.lang.invoke.MethodHandles; +import java.net.InetSocketAddress; +import java.util.Arrays; +import java.util.Properties; +import javax.net.ssl.SSLException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GrpcBootstrap implements Bootstrap { Review comment: Can we still use the Bootstrap from the saga server? 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 #265: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#discussion_r212142290 ## File path: 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.ParticipatedEvent; +import org.apache.servicecomb.saga.common.TransactionStatus; +import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand; + +/** + * Grpc omega callback for TCC workflow. + * + * @author zhaojun Review comment: We don't use the author annotation in our code, people can look it up by using git . 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 #265: SCB-865 Implement reaction of the event in Alpha Server
coveralls commented on issue #265: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/265#issuecomment-415079111 [![Coverage Status](https://coveralls.io/builds/18612978/badge)](https://coveralls.io/builds/18612978) Coverage decreased (-3.3%) to 87.601% when pulling **58b47839a735a5b9e0ae524c4d9e94b33ee08be6 on cherrylzhao:master** into **0ee4c59169224e9a2f4ab76f44216a2784df02bd 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] wujimin commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api
wujimin commented on a change in pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882#discussion_r211966301 ## File path: swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/core/processor/annotation/ApiProcessor.java ## @@ -17,18 +17,69 @@ package org.apache.servicecomb.swagger.generator.core.processor.annotation; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.apache.servicecomb.swagger.generator.core.ClassAnnotationProcessor; import org.apache.servicecomb.swagger.generator.core.SwaggerGenerator; import org.springframework.util.StringUtils; import io.swagger.annotations.Api; +import io.swagger.models.Swagger; public class ApiProcessor implements ClassAnnotationProcessor { @Override public void process(Object annotation, SwaggerGenerator swaggerGenerator) { Api api = (Api) annotation; setTags(api, swaggerGenerator); +// except for @Api, @RequestMapping can also set consumes and produces +// @RequestMapping takes HIGHER priority than @Api for legacy reason +processConsumes(api, swaggerGenerator.getSwagger()); Review comment: i can not find the priority control 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 #424: Docker hub 中的service center 镜像说明需要优化
little-cui commented on issue #424: Docker hub 中的service center 镜像说明需要优化 URL: https://github.com/apache/incubator-servicecomb-service-center/issues/424#issuecomment-415008904 关于变了命名容易被混淆问题已经提PR,请检视 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 SCB-665 deleted (was 62636f1)
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. was 62636f1 SCB-817 Fixed typo of the GrpcTccEvent.proto The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[GitHub] WillemJiang closed pull request #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP)
WillemJiang closed pull request #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP) URL: https://github.com/apache/incubator-servicecomb-saga/pull/264 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/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 54e7d5cd62e11fa2055a762e37feb9eac3539054 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] 08/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit f8549f9ec1871ec7a19981adfa7c92f09672ce73 Author: Willem Jiang AuthorDate: Wed Aug 22 16:52:24 2018 +0800 SCB-817 Updated the pack-contracts protocal for TCC --- .../src/main/proto/GrpcTccEvent.proto | 21 ++--- 1 file changed, 14 insertions(+), 7 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 14801b2..f482a93 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -26,7 +26,7 @@ import "GrpcCommon.proto"; service TccEventService { rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { } - rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {} + rpc participate(GrpcTccParticipatedEvent) returns (GrpcAck) {} rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { @@ -38,16 +38,20 @@ message GrpcTccTransactionStartedEvent { string globalTxId = 2; string localTxId = 3; string parentTxId = 4; + string serviceName = 5; + string instanceId = 6; } -message GrpcTccParticipateEvent { +message GrpcTccParticipatedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; - string confirmMethod = 6; - string cancelMethod = 7; - string status = 8; + string serviceName = 5; + string instanceId = 6; + string confirmMethod = 7; + string cancelMethod = 8; + string status = 9; } message GrpcTccTransactionEndedEvent { @@ -55,13 +59,16 @@ message GrpcTccTransactionEndedEvent { string globalTxId = 2; string localTxId = 3; string parentTxId = 4; - string status = 5; + string serviceName = 5; + string instanceId = 6; + string status = 7; } message GrpcTccCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string method = 4; + string serviceName = 4; + string method = 5; }
[incubator-servicecomb-saga] 03/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 05550fa0181931d2a11aada3412c5080b7997b49 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] 09/10: SCB-817 Added the license header
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 44c85b5bb0843bc747772c8842d3d76ea6ebe900 Author: Willem Jiang AuthorDate: Wed Aug 22 18:52:23 2018 +0800 SCB-817 Added the license header --- .../saga/omega/context/annotations/TccStart.java| 17 + .../saga/omega/transaction/tcc/TccEventService.java | 17 + 2 files changed, 34 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 index 6c8afd2..c7f8369 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 @@ -1,3 +1,20 @@ +/* + * 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.context.annotations; import static java.lang.annotation.ElementType.METHOD; 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 ae011bc..a722f49 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,3 +1,20 @@ +/* + * 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 org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
[incubator-servicecomb-saga] 07/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 8814789a3070b35a17cbbc1e7638c9e7502beb83 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] 10/10: SCB-817 Fixed typo of the GrpcTccEvent.proto
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 0ee4c59169224e9a2f4ab76f44216a2784df02bd Author: Willem Jiang AuthorDate: Wed Aug 22 19:21:58 2018 +0800 SCB-817 Fixed typo of the GrpcTccEvent.proto --- pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f482a93..64731b0 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -24,7 +24,7 @@ option java_outer_classname = "TccEventProto"; import "GrpcCommon.proto"; service TccEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCoordinateCommand) { } rpc participate(GrpcTccParticipatedEvent) returns (GrpcAck) {} rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} @@ -64,7 +64,7 @@ message GrpcTccTransactionEndedEvent { string status = 7; } -message GrpcTccCordinateCommand { +message GrpcTccCoordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3;
[incubator-servicecomb-saga] 02/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 2cca74fcbb8261563dfac82da2f5a480d0fd3af2 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] 05/10: 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 master in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git commit 92f079d82ba4d814709cae51911780b92c85f552 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] 04/10: SCB-817 Added the License headers
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 7f07b4a72cc3b1eb49d61828e52b526f3fcce814 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
[GitHub] coveralls edited a comment on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP)
coveralls edited a comment on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP) URL: https://github.com/apache/incubator-servicecomb-saga/pull/264#issuecomment-414977196 [![Coverage Status](https://coveralls.io/builds/18608352/badge)](https://coveralls.io/builds/18608352) Coverage decreased (-2.7%) to 90.864% when pulling **62636f1a07f90cc9c8a4f3c03c4173c5415667a9 on SCB-665** into **4c8b15f90a865384535f0ee154c271b4753f453a on 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
[incubator-servicecomb-saga] branch SCB-665 updated: SCB-817 Fixed typo of the GrpcTccEvent.proto
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 The following commit(s) were added to refs/heads/SCB-665 by this push: new 62636f1 SCB-817 Fixed typo of the GrpcTccEvent.proto 62636f1 is described below commit 62636f1a07f90cc9c8a4f3c03c4173c5415667a9 Author: Willem Jiang AuthorDate: Wed Aug 22 19:21:58 2018 +0800 SCB-817 Fixed typo of the GrpcTccEvent.proto --- pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f482a93..64731b0 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -24,7 +24,7 @@ option java_outer_classname = "TccEventProto"; import "GrpcCommon.proto"; service TccEventService { - rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { + rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCoordinateCommand) { } rpc participate(GrpcTccParticipatedEvent) returns (GrpcAck) {} rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} @@ -64,7 +64,7 @@ message GrpcTccTransactionEndedEvent { string status = 7; } -message GrpcTccCordinateCommand { +message GrpcTccCoordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3;
[GitHub] coveralls edited a comment on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP)
coveralls edited a comment on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP) URL: https://github.com/apache/incubator-servicecomb-saga/pull/264#issuecomment-414977196 [![Coverage Status](https://coveralls.io/builds/18607862/badge)](https://coveralls.io/builds/18607862) Coverage decreased (-2.6%) to 90.902% when pulling **478f811accea371259cf535d47f68949c40fa3af on SCB-665** into **4c8b15f90a865384535f0ee154c271b4753f453a on 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
[incubator-servicecomb-saga] branch SCB-665 updated: SCB-817 Added the license header
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 The following commit(s) were added to refs/heads/SCB-665 by this push: new 478f811 SCB-817 Added the license header 478f811 is described below commit 478f811accea371259cf535d47f68949c40fa3af Author: Willem Jiang AuthorDate: Wed Aug 22 18:52:23 2018 +0800 SCB-817 Added the license header --- .../saga/omega/context/annotations/TccStart.java| 17 + .../saga/omega/transaction/tcc/TccEventService.java | 17 + 2 files changed, 34 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 index 6c8afd2..c7f8369 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 @@ -1,3 +1,20 @@ +/* + * 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.context.annotations; import static java.lang.annotation.ElementType.METHOD; 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 ae011bc..a722f49 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,3 +1,20 @@ +/* + * 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 org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
[GitHub] coveralls commented on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP)
coveralls commented on issue #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP) URL: https://github.com/apache/incubator-servicecomb-saga/pull/264#issuecomment-414977196 [![Coverage Status](https://coveralls.io/builds/18606627/badge)](https://coveralls.io/builds/18606627) Coverage decreased (-2.7%) to 90.864% when pulling **07af5366b087f6012adf6f1713cbeecbdadc8393 on SCB-665** into **4c8b15f90a865384535f0ee154c271b4753f453a on 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] imlidian opened a new pull request #46: General development dir translation
imlidian opened a new pull request #46: General development dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/46 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 opened a new pull request #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP)
WillemJiang opened a new pull request #264: SCB-816, SCB-817 Added the TCC event and Grpc protocol (WIP) URL: https://github.com/apache/incubator-servicecomb-saga/pull/264 * Added the Grpc TCC contract * Added the TCC service and events NOTE: As these part of work is new added, this change won't affect current code. 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] 03/08: 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 258c2de5189d002ff4ee6dc2be5ac4fd1bb3472b 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] 05/08: 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 a46088784c43c5d3790bcb1fd886d476d00ad3c4 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] 07/08: 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 0cc9678d4950062ed04bccef4eeea3b71d570564 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] 01/08: 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 f8cd69c9acd709426d320e61fb37f6a3c6a6c99b 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] 06/08: 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 d067ce707b643751dde09dc0530fb76235d2370b 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] 04/08: 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 8ce5019a836ddd7b212e533cdc3d3ec44662e18b 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 (7718071 -> 07af536)
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 7718071 SCB-818 Omega supports of TCC (WIP) discard eae940b SCB-817 Updated the TCC grpc contract file discard b70984a SCB-817 Updated the grpc file of TccEventService discard 8c0a63c SCB-817 Added the License headers discard 09cb574 SCB-817 Updated the pack-contracts protocal for TCC discard 35d946c SCB-817 Added TCC events in Omega part (WIP) discard 95ad81f SCB-817 Added TCC events in Omega part (WIP) add 11dff7b Add the debugging method in spring-demo's document. add f375c61 Add the ref to debugging in other demos' documents. add 4c8b15f Add the ref to debugging in root document's quick start section. new f8cd69c SCB-817 Added TCC events in Omega part (WIP) new 780f324 SCB-817 Added TCC events in Omega part (WIP) new 258c2de SCB-817 Updated the pack-contracts protocal for TCC new 8ce5019 SCB-817 Added the License headers new a460887 SCB-817 Updated the grpc file of TccEventService new d067ce7 SCB-817 Updated the TCC grpc contract file new 0cc9678 SCB-818 Omega supports of TCC (WIP) new 07af536 SCB-817 Updated the pack-contracts protocal for TCC 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 (7718071) \ N -- N -- N refs/heads/SCB-665 (07af536) 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 8 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 | 1 + README_ZH.md| 1 + .../src/main/proto/GrpcTccEvent.proto | 21 ++--- saga-demo/conditional-transaction-demo/README.md| 3 +++ .../dependency-free-transaction-demo/README.md | 3 +++ saga-demo/saga-dubbo-demo/README.md | 8 ++-- saga-demo/saga-servicecomb-demo/README.md | 5 - saga-demo/saga-spring-demo/README.md| 18 ++ 8 files changed, 50 insertions(+), 10 deletions(-)
[incubator-servicecomb-saga] 02/08: 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 780f324e7173181cfed6a764377a74735d502d63 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] 08/08: 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 07af5366b087f6012adf6f1713cbeecbdadc8393 Author: Willem Jiang AuthorDate: Wed Aug 22 16:52:24 2018 +0800 SCB-817 Updated the pack-contracts protocal for TCC --- .../src/main/proto/GrpcTccEvent.proto | 21 ++--- 1 file changed, 14 insertions(+), 7 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 14801b2..f482a93 100644 --- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto +++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto @@ -26,7 +26,7 @@ import "GrpcCommon.proto"; service TccEventService { rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) { } - rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {} + rpc participate(GrpcTccParticipatedEvent) returns (GrpcAck) {} rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns (GrpcAck) {} rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {} rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) { @@ -38,16 +38,20 @@ message GrpcTccTransactionStartedEvent { string globalTxId = 2; string localTxId = 3; string parentTxId = 4; + string serviceName = 5; + string instanceId = 6; } -message GrpcTccParticipateEvent { +message GrpcTccParticipatedEvent { int64 timestamp = 1; string globalTxId = 2; string localTxId = 3; string parentTxId = 4; - string confirmMethod = 6; - string cancelMethod = 7; - string status = 8; + string serviceName = 5; + string instanceId = 6; + string confirmMethod = 7; + string cancelMethod = 8; + string status = 9; } message GrpcTccTransactionEndedEvent { @@ -55,13 +59,16 @@ message GrpcTccTransactionEndedEvent { string globalTxId = 2; string localTxId = 3; string parentTxId = 4; - string status = 5; + string serviceName = 5; + string instanceId = 6; + string status = 7; } message GrpcTccCordinateCommand { string globalTxId = 1; string localTxId = 2; string parentTxId = 3; - string method = 4; + string serviceName = 4; + string method = 5; }
[GitHub] yhs0092 opened a new pull request #882: [SCB-206] Support setting produces and consumes by @Api
yhs0092 opened a new pull request #882: [SCB-206] Support setting produces and consumes by @Api URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/882 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. - [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- See details in [SCB-206](https://issues.apache.org/jira/browse/SCB-206) 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 #263: Docs/debugging
coveralls edited a comment on issue #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263#issuecomment-414929014 [![Coverage Status](https://coveralls.io/builds/18605549/badge)](https://coveralls.io/builds/18605549) Coverage increased (+0.5%) to 93.545% when pulling **b89125e96efebf0b62a8d44fbbe82813b3a4a472 on crystaldust:docs/debugging** into **0e3593eecbea677bd0a732ef57c64b4df754f7c5 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 #263: Docs/debugging
coveralls edited a comment on issue #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263#issuecomment-414929014 [![Coverage Status](https://coveralls.io/builds/18605465/badge)](https://coveralls.io/builds/18605465) Coverage increased (+0.4%) to 93.466% when pulling **b89125e96efebf0b62a8d44fbbe82813b3a4a472 on crystaldust:docs/debugging** into **0e3593eecbea677bd0a732ef57c64b4df754f7c5 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
[incubator-servicecomb-saga] branch master updated (0e3593e -> 4c8b15f)
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 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 11dff7b Add the debugging method in spring-demo's document. new f375c61 Add the ref to debugging in other demos' documents. new 4c8b15f Add the ref to debugging in root document's quick start section. 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: README.md| 1 + README_ZH.md | 1 + saga-demo/conditional-transaction-demo/README.md | 3 +++ saga-demo/dependency-free-transaction-demo/README.md | 3 +++ saga-demo/saga-dubbo-demo/README.md | 8 ++-- saga-demo/saga-servicecomb-demo/README.md| 5 - saga-demo/saga-spring-demo/README.md | 18 ++ 7 files changed, 36 insertions(+), 3 deletions(-)
[incubator-servicecomb-saga] 02/03: Add the ref to debugging in other demos' documents.
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 f375c613d3e6916287149a5b7066d8cdf89ed495 Author: Zhen Ju AuthorDate: Wed Aug 22 16:14:41 2018 +0800 Add the ref to debugging in other demos' documents. --- saga-demo/conditional-transaction-demo/README.md | 3 +++ saga-demo/dependency-free-transaction-demo/README.md | 3 +++ saga-demo/saga-dubbo-demo/README.md | 8 ++-- saga-demo/saga-servicecomb-demo/README.md| 5 - 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/saga-demo/conditional-transaction-demo/README.md b/saga-demo/conditional-transaction-demo/README.md index 9ae1deb..505a666 100755 --- a/saga-demo/conditional-transaction-demo/README.md +++ b/saga-demo/conditional-transaction-demo/README.md @@ -172,3 +172,6 @@ So the 2nd request will trigger product replenishment from supplier. for simplicity. To see all events generated by Saga, visit `http://:8083/events` with postman. + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/dependency-free-transaction-demo/README.md b/saga-demo/dependency-free-transaction-demo/README.md index 611dfa5..4fb6e0f 100755 --- a/saga-demo/dependency-free-transaction-demo/README.md +++ b/saga-demo/dependency-free-transaction-demo/README.md @@ -166,3 +166,6 @@ Sending the request more than once will trigger compensation due to insufficient for simplicity. To see all events generated by Saga, visit `http://:8083/events` with browser. + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md index 098fd85..deadb4f 100644 --- a/saga-demo/saga-dubbo-demo/README.md +++ b/saga-demo/saga-dubbo-demo/README.md @@ -15,6 +15,10 @@ You will need: [alpha_server]: https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha ## Running Demo -1.mvn clean install -DskipTests -Pdocker -2. ./saga-dubbo-demo.sh up +```bash +$ mvn clean install -DskipTests -Pdocker +$ ./saga-dubbo-demo.sh up +``` +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/saga-servicecomb-demo/README.md b/saga-demo/saga-servicecomb-demo/README.md index f9cd821..e08b416 100644 --- a/saga-demo/saga-servicecomb-demo/README.md +++ b/saga-demo/saga-servicecomb-demo/README.md @@ -58,4 +58,7 @@ Check the car booking status with ``` curl http://${host_address}:8082/bookings ``` -The second car booking will be marked with **cancel:true** \ No newline at end of file +The second car booking will be marked with **cancel:true** + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
[incubator-servicecomb-saga] 03/03: Add the ref to debugging in root document's quick start section.
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 4c8b15f90a865384535f0ee154c271b4753f453a Author: Zhen Ju AuthorDate: Wed Aug 22 16:15:11 2018 +0800 Add the ref to debugging in root document's quick start section. --- README.md| 1 + README_ZH.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index eb009f4..48ca2ad 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ See [Saga Pack Design](docs/design.md) for details. * For ServiceComb Java Chassis application, please see [Booking Demo](saga-demo/saga-servicecomb-demo/README.md) for details. * For Spring applications, please see [Booking Demo](saga-demo/saga-spring-demo/README.md) for details. * For Dubbo applications, please see [Dubbo Demo](saga-demo/saga-dubbo-demo/README.md) for details. +* To debug the applications, please see [Spring Demo Debugging](saga-demo/saga-spring-demo#debugging) for details. ## Build and Run the tests from source * Build the source code and run the tests diff --git a/README_ZH.md b/README_ZH.md index 0531441..200086f 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -27,6 +27,7 @@ Saga是由 **alpha** 和 **omega**组成,其中: * Saga在ServiceComb Java Chassis应用可以参考[出行预订](saga-demo/saga-servicecomb-demo/README.md) * Saga在Spring应用的用法可参考[出行预订示例](saga-demo/saga-spring-demo/README.md)。 * Saga在Dubbo应用的用法可参考[Dubbo示例](saga-demo/saga-dubbo-demo/README.md). +* Saga的调试方法可以参考[调试Spring示例](saga-demo/saga-spring-demo#debugging). ## 编译和运行代码 * 编译代码并且运行相关的单元测试
[incubator-servicecomb-saga] 01/03: Add the debugging method in spring-demo's document.
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 11dff7bfe9bede80e6b897fd9f4e05c8f6fea8f9 Author: Zhen Ju AuthorDate: Wed Aug 22 16:13:44 2018 +0800 Add the debugging method in spring-demo's document. --- saga-demo/saga-spring-demo/README.md | 18 ++ 1 file changed, 18 insertions(+) diff --git a/saga-demo/saga-spring-demo/README.md b/saga-demo/saga-spring-demo/README.md index a5c7b5a..0502493 100644 --- a/saga-demo/saga-spring-demo/README.md +++ b/saga-demo/saga-spring-demo/README.md @@ -125,3 +125,21 @@ The second car booking will be marked with **cancel:true** Open a browser with URL http://127.0.0.1:8083, You will get a html page. You can use this page to invoke test cases, and then get results. **Note** transactions and compensations implemented by services must be idempotent. + +## Debugging + +To debug the services of the demo, just add debug parameter to JVM through the environment field in docker-compose configs. Let's take alpha-server as an example: + +```yaml +alpha: + image: "alpha-server:${TAG}" + environment: +- JAVA_OPTS=-Dspring.profiles.active=prd -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 + ports: +- "6006:5005" +... +``` + +We append the debug parameter `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005` to the JAVA_OPTS environment variable, the Java process inside the container will listen on port 5005. With the port forwarding rule `6006:5005`, when alpha-server is ready, we can connect to port 6006 on the host and start debugging alpha-server. + +If you're using [IntelliJ](https://www.jetbrains.com/idea/), open the saga project, create a new debug configuration with template 'Remote', fill "Host" and "Port" input with "localhost" and "6006", then select "alpha" in the drop-down list of "Use classpath of module". When alpha-server is running, hit shift+f9 to debug the remote application.
[GitHub] WillemJiang closed pull request #263: Docs/debugging
WillemJiang closed pull request #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263 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/README.md b/README.md index eb009f40..48ca2add 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ See [Saga Pack Design](docs/design.md) for details. * For ServiceComb Java Chassis application, please see [Booking Demo](saga-demo/saga-servicecomb-demo/README.md) for details. * For Spring applications, please see [Booking Demo](saga-demo/saga-spring-demo/README.md) for details. * For Dubbo applications, please see [Dubbo Demo](saga-demo/saga-dubbo-demo/README.md) for details. +* To debug the applications, please see [Spring Demo Debugging](saga-demo/saga-spring-demo#debugging) for details. ## Build and Run the tests from source * Build the source code and run the tests diff --git a/README_ZH.md b/README_ZH.md index 05314410..200086f9 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -27,6 +27,7 @@ Saga是由 **alpha** 和 **omega**组成,其中: * Saga在ServiceComb Java Chassis应用可以参考[出行预订](saga-demo/saga-servicecomb-demo/README.md) * Saga在Spring应用的用法可参考[出行预订示例](saga-demo/saga-spring-demo/README.md)。 * Saga在Dubbo应用的用法可参考[Dubbo示例](saga-demo/saga-dubbo-demo/README.md). +* Saga的调试方法可以参考[调试Spring示例](saga-demo/saga-spring-demo#debugging). ## 编译和运行代码 * 编译代码并且运行相关的单元测试 diff --git a/saga-demo/conditional-transaction-demo/README.md b/saga-demo/conditional-transaction-demo/README.md index 9ae1deb6..505a6667 100755 --- a/saga-demo/conditional-transaction-demo/README.md +++ b/saga-demo/conditional-transaction-demo/README.md @@ -172,3 +172,6 @@ So the 2nd request will trigger product replenishment from supplier. for simplicity. To see all events generated by Saga, visit `http://:8083/events` with postman. + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/dependency-free-transaction-demo/README.md b/saga-demo/dependency-free-transaction-demo/README.md index 611dfa5e..4fb6e0f5 100755 --- a/saga-demo/dependency-free-transaction-demo/README.md +++ b/saga-demo/dependency-free-transaction-demo/README.md @@ -166,3 +166,6 @@ Sending the request more than once will trigger compensation due to insufficient for simplicity. To see all events generated by Saga, visit `http://:8083/events` with browser. + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md index 098fd853..deadb4f1 100644 --- a/saga-demo/saga-dubbo-demo/README.md +++ b/saga-demo/saga-dubbo-demo/README.md @@ -15,6 +15,10 @@ You will need: [alpha_server]: https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha ## Running Demo -1.mvn clean install -DskipTests -Pdocker -2. ./saga-dubbo-demo.sh up +```bash +$ mvn clean install -DskipTests -Pdocker +$ ./saga-dubbo-demo.sh up +``` +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/saga-servicecomb-demo/README.md b/saga-demo/saga-servicecomb-demo/README.md index f9cd821a..e08b4160 100644 --- a/saga-demo/saga-servicecomb-demo/README.md +++ b/saga-demo/saga-servicecomb-demo/README.md @@ -58,4 +58,7 @@ Check the car booking status with ``` curl http://${host_address}:8082/bookings ``` -The second car booking will be marked with **cancel:true** \ No newline at end of file +The second car booking will be marked with **cancel:true** + +## Debugging +Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference. diff --git a/saga-demo/saga-spring-demo/README.md b/saga-demo/saga-spring-demo/README.md index a5c7b5ae..05024938 100644 --- a/saga-demo/saga-spring-demo/README.md +++ b/saga-demo/saga-spring-demo/README.md @@ -125,3 +125,21 @@ The second car booking will be marked with **cancel:true** Open a browser with URL http://127.0.0.1:8083, You will get a html page. You can use this page to invoke test cases, and then get results. **Note** transactions and compensations implemented by services must be idempotent. + +## Debugging + +To debug the services of the demo, just add debug parameter to JVM through the environment field in docker-compose configs. Let's take alpha-server as an example: + +```yaml +alpha: + image: "alpha-server:${TAG}" + environment: +- JAVA_OPTS=-Dspring.profiles.active=prd -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 + ports: +- "6006:5005" +... +``` + +We append the debug parameter `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005` to the JAVA_OPTS environment variable, the Java process inside the container will
[GitHub] WillemJiang commented on a change in pull request #262: SCB-865 Implement reaction of the event in Alpha Server
WillemJiang commented on a change in pull request #262: SCB-865 Implement reaction of the event in Alpha Server URL: https://github.com/apache/incubator-servicecomb-saga/pull/262#discussion_r211864328 ## File path: alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/tcc/server/event/ParticipateEvent.java ## @@ -0,0 +1,113 @@ +/* + * 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 { + + private String globalTxId; + private String localTxId; + private String parentTxId; + private String serviceName; Review comment: we don't need specify the serviceName and instanceId information 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 issue #263: Docs/debugging
WillemJiang commented on issue #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263#issuecomment-414947534 Please add a reference in the ReadMe file. 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 #45: tiny change for char: *
wujimin opened a new pull request #45: tiny change for char: * URL: https://github.com/apache/incubator-servicecomb-docs/pull/45 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 closed pull request #410: [SCB-812]Change the readme under the frontend folder
xiaoyimei closed pull request #410: [SCB-812]Change the readme under the frontend folder URL: https://github.com/apache/incubator-servicecomb-service-center/pull/410 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/frontend/Readme.md b/frontend/Readme.md index 77e6f85f..dde0dc71 100644 --- a/frontend/Readme.md +++ b/frontend/Readme.md @@ -39,7 +39,17 @@ bower install cd .. -go run main.go +go build + +``` +Windows: +``` +frontend.exe +``` + +Linux: +```sh +./frontend ``` This will bring up the Service-Center UI on [http://127.0.0.1:30103](http://127.0.0.1:30103). If you want to change the listening ip/port, you can modify it in the configuration file (service-center/frontend/conf/app.conf : frontend_host_ip, frontend_host_port). diff --git a/frontend/app/scripts/modules/topology/controllers/topologyCtrl.js b/frontend/app/scripts/modules/topology/controllers/topologyCtrl.js index d7da9952..d6952273 100644 --- a/frontend/app/scripts/modules/topology/controllers/topologyCtrl.js +++ b/frontend/app/scripts/modules/topology/controllers/topologyCtrl.js @@ -114,7 +114,7 @@ angular.module('serviceCenter.topology', []) } function createTopology() { -var microServices = new vis.DataSet($scope.microServices); +var microServices = new vis.DataSet($scope.microServices.slice(0,100)); var prosAndCons = new vis.DataSet($scope.prosAndCons); var container = document.getElementById('topology'); var data = { 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 commented on issue #410: [SCB-812]Change the readme under the frontend folder
xiaoyimei commented on issue #410: [SCB-812]Change the readme under the frontend folder URL: https://github.com/apache/incubator-servicecomb-service-center/pull/410#issuecomment-414945680 The content of this PR is already included in the PR428. 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 closed pull request #44: improve description of rest-over-servlet
liubao68 closed pull request #44: improve description of rest-over-servlet URL: https://github.com/apache/incubator-servicecomb-docs/pull/44 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/protocol/rest-over-servlet.md b/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md index 5e08543..9a3dd77 100644 --- a/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md +++ b/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md @@ -1,20 +1,109 @@ # REST over Servlet +REST over Servlet对应使用web容器部署运行,需要新建一个servlet工程将微服务包装起来,打成war包,加载到web容器中启动运行。 +## 对外发布的Path +当微服务部署到web容器中时,相对于独立运行,会涉及到web root以及servlet url pattern对url的改变。 +对于传统开发框架而言,需要consumer感知对方的完整url;比如web root为/mywebapp,url pattern为/rest,业务级path为/application,则consumer代码必须通过/mywebapp/rest/application来访问。 +这将导致一旦部署方式发生变化,比如从web容器变成standalone运行,则consumer或是producer必须修改代码来适配这个变化。 -## 配置说明 +建议使用ServiceComb的部署解耦特性,无论是consumer,还是producer,在代码中都不要感知web root以及url pattern,这样ServiceComb在运行时,会自动适配producer实例的web root以及url pattern。 -REST over Servlet对应使用web容器模式部署运行,需要新建一个servlet工程将微服务包装起来,加载到web容器中启动运行,包装微服务的方法有两种,一种完全使用web.xml配置文件配置,另一种仅在web.xml文件中配置listener,在microservice.yaml文件中配置urlPattern,两种方式任选一种即可,配置方式如下所示: +对于一些遗留系统改造,用户期望继续使用restTemplate.getForObject("cse://serviceName/mywebapp/rest/application"...),这个时候,用户必须将接口定义的path定位为: /mywebapp/rest/application,例如: +``` +@RestSchema(schemaId = "test") +@RequestMapping(path = "/mywebapp/rest/application") +``` -* 在web.xml文件中完成全部配置 - web.xml文件配置在项目的src/main/webapp/WEB\_INF目录,配置内容如下: +尽管如此,仍然推荐使用部署形态无关的方式来编码,可以减少后续由于部署形态变化,带来的修改代码问题。 +## maven依赖 +```xml + +org.apache.servicecomb +transport-rest-servlet + +``` +## 配置说明 +与servlet机制配合,涉及到以下几个概念: +* 启动spring context + 注意以下几种启动方式,是N选1的关系,不要同时使用。 + * 不使用springMVC的UI或RestController ```xml http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; version="3.0"> -contextConfigLocation -classpath*:META-INF/spring/*.bean.xml + contextConfigLocation + classpath*:META-INF/spring/*.bean.xml + + org.apache.servicecomb.transport.rest.servlet.RestServletContextListener + + + ``` + 其中classpath*:META-INF/spring/*.bean.xml,无论任何情况,都可以不在contextConfigLocation中配置,因为ServiceComb机制会确保加载路径中包含它。 + 这里仅仅是个示例,表示如果使用者需要定制contextConfigLocation,可以使用这个方法。 + + * 使用springMVC的UI或RestController,且存在org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet + ```xml + http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; + version="3.0"> + + SpringMVCServlet + org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet + 1 + + + SpringMVCServlet + yourUrlPattern + + + ``` +**注意:** +该servlet不是ServiceComb的处理入口,仅仅是UI或RestController的处理入口 + * 使用springMVC的UI或RestController,且不存在org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet +需要继承springMVC的DispatcherServlet,再按CseDispatcherServlet的方式,配置自己的实现类 + ``` + @Override + protected WebApplicationContext createWebApplicationContext(ApplicationContext parent){ +setContextClass(CseXmlWebApplicationContext.class); +return super.createWebApplicationContext(parent); + } + ``` +* ServiceComb servlet + url pattern根据业务自身规划设置即可,下面的/rest/*仅仅是示例,不是固定值。 + url pattern必须以/*结尾 + 以下两种声明方式也是多选一的关系,不要同时使用 + * 标准声明 + ```xml + http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; + version="3.0"> + +RestServlet + org.apache.servicecomb.transport.rest.servlet.RestServlet +1 +true + + +RestServlet +/rest/* + + + ``` + * 快捷声明 + 在microservice.yaml文件中指定urlPattern,ServiceComb启动时会自动创建RestServlet,并设置相应的urlPattern: + ```yaml + servicecomb.rest.servlet.urlPattern: /rest/* + ``` + +## 典型场景配置示例 +* 纯ServiceComb,标准声明 + web.xml + ```xml + http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; + version="3.0"> org.apache.servicecomb.transport.rest.servlet.RestServletContextListener @@ -30,61 +119,67 @@ REST
[incubator-servicecomb-docs] branch master updated: improve description of rest-over-servlet
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 cfd7b38 improve description of rest-over-servlet cfd7b38 is described below commit cfd7b38440a114e934c25afcd649d4e1cd107aec Author: wujimin AuthorDate: Wed Aug 22 11:21:21 2018 +0800 improve description of rest-over-servlet --- .../build-provider/protocol/rest-over-servlet.md | 210 ++--- .../build-provider/protocol/rest-over-servlet.md | 210 ++--- 2 files changed, 286 insertions(+), 134 deletions(-) diff --git a/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md b/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md index 5e08543..9a3dd77 100644 --- a/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md +++ b/java-chassis-reference/en_US/build-provider/protocol/rest-over-servlet.md @@ -1,21 +1,110 @@ # REST over Servlet +REST over Servlet对应使用web容器部署运行,需要新建一个servlet工程将微服务包装起来,打成war包,加载到web容器中启动运行。 +## 对外发布的Path +当微服务部署到web容器中时,相对于独立运行,会涉及到web root以及servlet url pattern对url的改变。 +对于传统开发框架而言,需要consumer感知对方的完整url;比如web root为/mywebapp,url pattern为/rest,业务级path为/application,则consumer代码必须通过/mywebapp/rest/application来访问。 +这将导致一旦部署方式发生变化,比如从web容器变成standalone运行,则consumer或是producer必须修改代码来适配这个变化。 -## 配置说明 +建议使用ServiceComb的部署解耦特性,无论是consumer,还是producer,在代码中都不要感知web root以及url pattern,这样ServiceComb在运行时,会自动适配producer实例的web root以及url pattern。 -REST over Servlet对应使用web容器模式部署运行,需要新建一个servlet工程将微服务包装起来,加载到web容器中启动运行,包装微服务的方法有两种,一种完全使用web.xml配置文件配置,另一种仅在web.xml文件中配置listener,在microservice.yaml文件中配置urlPattern,两种方式任选一种即可,配置方式如下所示: +对于一些遗留系统改造,用户期望继续使用restTemplate.getForObject("cse://serviceName/mywebapp/rest/application"...),这个时候,用户必须将接口定义的path定位为: /mywebapp/rest/application,例如: +``` +@RestSchema(schemaId = "test") +@RequestMapping(path = "/mywebapp/rest/application") +``` -* 在web.xml文件中完成全部配置 - web.xml文件配置在项目的src/main/webapp/WEB\_INF目录,配置内容如下: +尽管如此,仍然推荐使用部署形态无关的方式来编码,可以减少后续由于部署形态变化,带来的修改代码问题。 +## maven依赖 +```xml + +org.apache.servicecomb +transport-rest-servlet + +``` +## 配置说明 +与servlet机制配合,涉及到以下几个概念: +* 启动spring context + 注意以下几种启动方式,是N选1的关系,不要同时使用。 + * 不使用springMVC的UI或RestController ```xml http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; version="3.0"> -contextConfigLocation -classpath*:META-INF/spring/*.bean.xml + contextConfigLocation + classpath*:META-INF/spring/*.bean.xml + org.apache.servicecomb.transport.rest.servlet.RestServletContextListener + + + ``` + 其中classpath*:META-INF/spring/*.bean.xml,无论任何情况,都可以不在contextConfigLocation中配置,因为ServiceComb机制会确保加载路径中包含它。 + 这里仅仅是个示例,表示如果使用者需要定制contextConfigLocation,可以使用这个方法。 + + * 使用springMVC的UI或RestController,且存在org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet + ```xml + http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; + version="3.0"> + + SpringMVCServlet + org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet + 1 + + + SpringMVCServlet + yourUrlPattern + + + ``` +**注意:** +该servlet不是ServiceComb的处理入口,仅仅是UI或RestController的处理入口 + * 使用springMVC的UI或RestController,且不存在org.apache.servicecomb.transport.rest.servlet.CseDispatcherServlet +需要继承springMVC的DispatcherServlet,再按CseDispatcherServlet的方式,配置自己的实现类 + ``` + @Override + protected WebApplicationContext createWebApplicationContext(ApplicationContext parent){ +setContextClass(CseXmlWebApplicationContext.class); +return super.createWebApplicationContext(parent); + } + ``` +* ServiceComb servlet + url pattern根据业务自身规划设置即可,下面的/rest/*仅仅是示例,不是固定值。 + url pattern必须以/*结尾 + 以下两种声明方式也是多选一的关系,不要同时使用 + * 标准声明 + ```xml + http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd; + version="3.0"> + +RestServlet + org.apache.servicecomb.transport.rest.servlet.RestServlet +1 +true + + +RestServlet +/rest/* + + + ``` + * 快捷声明 + 在microservice.yaml文件中指定urlPattern,ServiceComb启动时会自动创建RestServlet,并设置相应的urlPattern: + ```yaml + servicecomb.rest.servlet.urlPattern: /rest/* + ``` + +## 典型场景配置示例 +* 纯ServiceComb,标准声明 + web.xml + ```xml + http://java.sun.com/xml/ns/javaee;
[GitHub] coveralls edited a comment on issue #881: [SCB-861]490, 590 response not properly used
coveralls edited a comment 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/18604762/badge)](https://coveralls.io/builds/18604762) Coverage increased (+0.05%) to 86.24% when pulling **a75f000a58adce451523a8814f0a085c6efbc1d8 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] imlidian commented on a change in pull request #40: Using java chassis in spring boot dir translation
imlidian commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211845862 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md ## @@ -1,73 +1,73 @@ -java chassis支持使用Spring MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。 -* 服务声明方式 +Java chassis supports the use of the label \(org.springframework.web.bind.annotation\) provided by Spring MVC to declare the REST interface, but the two are independent implementations and have different design goals. The goal of the java chassis is to provide a cross-language framework that supports multiple communication protocols. Therefore, some features of Spring MVC that are not very good for cross-language support are removed, and features that are strongly related to a specific running framework are not supported, such as direct access to the Servlet protocol definition. HttpServletRequest. Here are some notable differences. -Spring MVC使用@RestController声明服务,而java chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring MVC的标签还是使用JAX RS的标签。 +* Service declaration method + +Spring MVC uses @RestController to declare the service, and java chassis uses @RestSchema to declare the service and needs to display the service path using @RequestMapping to distinguish whether the service uses Spring MVC tags or JAX RS tags. ``` @RestSchema(schemaId = "hello") @RequestMapping(path = "/") ``` -Schema是java chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。 +The schema is the service contract of java chassis, which is the basis of service runtime. Service management, codec and so on are all based on contract. In a cross-language scenario, the contract also defines the parts of the language that can be understood simultaneously. -* 数据类型支持 +* Data type support -采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如: +With Spring MVC, you can use multiple data types in a service definition as long as it can be serialized and deserialized by json. Such as: ``` -// 抽象类型 -public void postData(@RequestBody Object data) -// 接口定义 -public void postData(@RequestBody IPerson interfaceData) -// 没指定类型的泛型 -public void postData(@RequestBody Map rawData) -// 具体协议相关的类型 -public void postData(HttpServletRequest rquest) +// abstract type +Public void postData(@RequestBody Object data) +// Interface definition +Public void postData(@RequestBody IPerson interfaceData) +// no generic type of the specified type +Public void postData(@RequestBody Map rawData) +// specific protocol related types +Public void postData(HttpServletRequest request) ``` -上面的类型在java chassis都不提供支持。因为java chassis会根据接口定义生成契约,从上面的接口定义,如果不结合实际的实现代码或者额外的开发文档说明,无法直接生成契约。也就是站在浏览器的REST视角,不知道如何在body里面构造消息内容。 +The above types are not supported in the java chassis. Because java chassis will generate contracts according to the interface definition, from the above interface definition, if you do not combine the actual implementation code or additional development documentation, you can not directly generate the contract. That is, standing in the REST perspective of the browser, I don't know how to construct the message content in the body. -为了支持快速开发,java chassis的数据类型限制也在不停的扩充,比如支持HttpServletRequest,但是实际在使用的时候,他们与WEB服务器的语义是不一样的,比如不能直接操作流。因此建议开发者在的使用场景下,尽可能使用契约能够描述的类型,让代码阅读性更好。 +To support rapid development, the data type restrictions of java chassis are also constantly expanding, such as support for HttpServletRequest, but when they are used, they are different from the semantics of the WEB server, such as the inability to directly manipulate the stream. Therefore, it is recommended that the developer use the type of contract that can be described as much as possible in the usage scenario so that the code is more readable. -java chassis在数据类型的支持方面的更多说明,请参考"支持的数据类型"章节。 +For more information on java chassis support for data types, please refer to the "Supported Data Types" section. -* 常用标签支持 +* Common label support Review comment: 那中文应该是注解才对,这个需要改下。标签当然是label 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211845512 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/web-application.md ## @@ -1,29 +1,29 @@ -Web开发方式和JAVA应用方式的开发步骤基本类似。 +The development steps of the web development method and the JAVA application method are similar. -本项目[代码示例](https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) +This project [code example] (https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) -主要有如下区别: +There are mainly the following differences: -* JAVA应用方式基于spring-boot-starter,而Web开发方式基于spring-boot-starter-web。 +* JAVA application is based on spring-boot-starter, and web development is based on spring-boot-starter-web. -* JAVA应用方式依赖spring-boot-starter-provider,而Web开发方式依赖spring-boot-starter-transport。spring-boot-starter-web已经携带了hibernate-validator,不需要额外依赖。 +* JAVA application relies on spring-boot-starter-provider, while web development relies on spring-boot-starter-transport. Spring-boot-starter-web already carries hibernate-validator and does not require additional dependencies. + +* In the startup function, the web development method can be declared -* 在启动函数中,Web开发方式可以通过声明 ``` @SpringBootApplication(exclude=DispatcherServletAutoConfiguration.class) ``` -来关闭org.springframework.web.servlet.DispatcherServlet,通过@EnableServiceComb会启用org.apache.servicecomb.transport.rest.servlet.RestServlet。虽然排除DispatcherServlet不是必须的,但是大多数场景一个微服务里面存在多个REST框架都不是很好的主意,会造成很多使用上的误解。 - -* 在microservice.yaml文件中通过配置项servicecomb.rest.servlet.urlPattern来指定RestServlet的URL根路径。并且配置项servicecomb.rest.address里面的监听端口,必须和tomcat监听的端口保持一致(默认是8080,可以通过application.yml中增加server.port修改) +To close org.springframework.web.servlet.DispatcherServlet, enable org.apache.servicecomb.transport.rest.servlet.RestServlet via @EnableServiceComb. Although it is not necessary to exclude the DispatcherServlet, it is not a good idea to have multiple REST frameworks in a microservice in most scenarios, which will cause many misunderstandings in use. Review comment: misunderstandings -> confusion 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211845278 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/web-application.md ## @@ -1,29 +1,29 @@ -Web开发方式和JAVA应用方式的开发步骤基本类似。 +The development steps of the web development method and the JAVA application method are similar. -本项目[代码示例](https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) +This project [code example] (https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) -主要有如下区别: +There are mainly the following differences: -* JAVA应用方式基于spring-boot-starter,而Web开发方式基于spring-boot-starter-web。 +* JAVA application is based on spring-boot-starter, and web development is based on spring-boot-starter-web. -* JAVA应用方式依赖spring-boot-starter-provider,而Web开发方式依赖spring-boot-starter-transport。spring-boot-starter-web已经携带了hibernate-validator,不需要额外依赖。 +* JAVA application relies on spring-boot-starter-provider, while web development relies on spring-boot-starter-transport. Spring-boot-starter-web already carries hibernate-validator and does not require additional dependencies. Review comment: relies ->depend 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211845163 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/web-application.md ## @@ -1,29 +1,29 @@ -Web开发方式和JAVA应用方式的开发步骤基本类似。 +The development steps of the web development method and the JAVA application method are similar. -本项目[代码示例](https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) +This project [code example] (https://github.com/huaweicse/servicecomb-java-chassis-samples/tree/master/spring-boot-web) -主要有如下区别: +There are mainly the following differences: Review comment: There are mainly the following differences: 这句话有点奇怪? 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211845026 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/web-application.md ## @@ -1,29 +1,29 @@ -Web开发方式和JAVA应用方式的开发步骤基本类似。 +The development steps of the web development method and the JAVA application method are similar. Review comment: method -> mode 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211844854 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/java-application.md ## @@ -54,18 +53,17 @@ public class WebsiteMain { ``` - -通过以上配置,就可以完整使用java chassis提供的所有功能,使用java chassis开发REST服务,并开启各种治理功能。 +With the above configuration, you can fully use all the functions provided by the java chassis, use the java chassis to develop REST services, and open various governance functions. -* 配置微服务 +* Configure microservices -通过microservice.yaml文件可以定制微服务的信息,包括应用名称、微服务名称、监听的地址和端口等。 +The microservice.yaml file allows you to customize the microservice information, including the application name, microservice name, listener address and port. Review comment: application name -> application id 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211844465 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/java-application.md ## @@ -1,12 +1,12 @@ -使用JAVA方式集成,为Spring Boot应用增加了一个高效的HTTP服务器和REST开发框架。这种方式集成非常简单。只需要在项目中引入相关依赖,并且使用@EnableServiceComb标签即可。 +Using JAVA integration, an efficient HTTP server and REST development framework has been added for Spring Boot applications. This way of integration is very simple. Just introduce the relevant dependencies into the project and use the @EnableServiceComb tag. Review comment: tag -> Annotation 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211844136 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md ## @@ -1,73 +1,73 @@ -java chassis支持使用Spring MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。 -* 服务声明方式 +Java chassis supports the use of the label \(org.springframework.web.bind.annotation\) provided by Spring MVC to declare the REST interface, but the two are independent implementations and have different design goals. The goal of the java chassis is to provide a cross-language framework that supports multiple communication protocols. Therefore, some features of Spring MVC that are not very good for cross-language support are removed, and features that are strongly related to a specific running framework are not supported, such as direct access to the Servlet protocol definition. HttpServletRequest. Here are some notable differences. -Spring MVC使用@RestController声明服务,而java chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring MVC的标签还是使用JAX RS的标签。 +* Service declaration method + +Spring MVC uses @RestController to declare the service, and java chassis uses @RestSchema to declare the service and needs to display the service path using @RequestMapping to distinguish whether the service uses Spring MVC tags or JAX RS tags. ``` @RestSchema(schemaId = "hello") @RequestMapping(path = "/") ``` -Schema是java chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。 +The schema is the service contract of java chassis, which is the basis of service runtime. Service management, codec and so on are all based on contract. In a cross-language scenario, the contract also defines the parts of the language that can be understood simultaneously. -* 数据类型支持 +* Data type support -采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如: +With Spring MVC, you can use multiple data types in a service definition as long as it can be serialized and deserialized by json. Such as: ``` -// 抽象类型 -public void postData(@RequestBody Object data) -// 接口定义 -public void postData(@RequestBody IPerson interfaceData) -// 没指定类型的泛型 -public void postData(@RequestBody Map rawData) -// 具体协议相关的类型 -public void postData(HttpServletRequest rquest) +// abstract type +Public void postData(@RequestBody Object data) +// Interface definition +Public void postData(@RequestBody IPerson interfaceData) +// no generic type of the specified type +Public void postData(@RequestBody Map rawData) +// specific protocol related types +Public void postData(HttpServletRequest request) ``` -上面的类型在java chassis都不提供支持。因为java chassis会根据接口定义生成契约,从上面的接口定义,如果不结合实际的实现代码或者额外的开发文档说明,无法直接生成契约。也就是站在浏览器的REST视角,不知道如何在body里面构造消息内容。 +The above types are not supported in the java chassis. Because java chassis will generate contracts according to the interface definition, from the above interface definition, if you do not combine the actual implementation code or additional development documentation, you can not directly generate the contract. That is, standing in the REST perspective of the browser, I don't know how to construct the message content in the body. -为了支持快速开发,java chassis的数据类型限制也在不停的扩充,比如支持HttpServletRequest,但是实际在使用的时候,他们与WEB服务器的语义是不一样的,比如不能直接操作流。因此建议开发者在的使用场景下,尽可能使用契约能够描述的类型,让代码阅读性更好。 +To support rapid development, the data type restrictions of java chassis are also constantly expanding, such as support for HttpServletRequest, but when they are used, they are different from the semantics of the WEB server, such as the inability to directly manipulate the stream. Therefore, it is recommended that the developer use the type of contract that can be described as much as possible in the usage scenario so that the code is more readable. -java chassis在数据类型的支持方面的更多说明,请参考"支持的数据类型"章节。 +For more information on java chassis support for data types, please refer to the "Supported Data Types" section. -* 常用标签支持 +* Common label support Review comment: 标签应该翻译为Annotation,不是label 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 #263: Docs/debugging
coveralls commented on issue #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263#issuecomment-414929014 [![Coverage Status](https://coveralls.io/builds/18604359/badge)](https://coveralls.io/builds/18604359) Coverage increased (+0.4%) to 93.466% when pulling **42134b86b0566de97fae6cca7eabb53632e6181a on crystaldust:docs/debugging** into **0e3593eecbea677bd0a732ef57c64b4df754f7c5 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 commented on issue #263: Docs/debugging
coveralls commented on issue #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263#issuecomment-414929013 [![Coverage Status](https://coveralls.io/builds/18604359/badge)](https://coveralls.io/builds/18604359) Coverage increased (+0.4%) to 93.466% when pulling **42134b86b0566de97fae6cca7eabb53632e6181a on crystaldust:docs/debugging** into **0e3593eecbea677bd0a732ef57c64b4df754f7c5 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211843101 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md ## @@ -1,73 +1,73 @@ -java chassis支持使用Spring MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。 -* 服务声明方式 +Java chassis supports the use of the label \(org.springframework.web.bind.annotation\) provided by Spring MVC to declare the REST interface, but the two are independent implementations and have different design goals. The goal of the java chassis is to provide a cross-language framework that supports multiple communication protocols. Therefore, some features of Spring MVC that are not very good for cross-language support are removed, and features that are strongly related to a specific running framework are not supported, such as direct access to the Servlet protocol definition. HttpServletRequest. Here are some notable differences. -Spring MVC使用@RestController声明服务,而java chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring MVC的标签还是使用JAX RS的标签。 +* Service declaration method + +Spring MVC uses @RestController to declare the service, and java chassis uses @RestSchema to declare the service and needs to display the service path using @RequestMapping to distinguish whether the service uses Spring MVC tags or JAX RS tags. ``` @RestSchema(schemaId = "hello") @RequestMapping(path = "/") ``` -Schema是java chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。 +The schema is the service contract of java chassis, which is the basis of service runtime. Service management, codec and so on are all based on contract. In a cross-language scenario, the contract also defines the parts of the language that can be understood simultaneously. -* 数据类型支持 +* Data type support -采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如: +With Spring MVC, you can use multiple data types in a service definition as long as it can be serialized and deserialized by json. Such as: ``` -// 抽象类型 -public void postData(@RequestBody Object data) -// 接口定义 -public void postData(@RequestBody IPerson interfaceData) -// 没指定类型的泛型 -public void postData(@RequestBody Map rawData) -// 具体协议相关的类型 -public void postData(HttpServletRequest rquest) +// abstract type +Public void postData(@RequestBody Object data) +// Interface definition +Public void postData(@RequestBody IPerson interfaceData) +// no generic type of the specified type Review comment: no generic type of the specified type 这个难以理解,修改一下 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211842895 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md ## @@ -1,73 +1,73 @@ -java chassis支持使用Spring MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。 -* 服务声明方式 +Java chassis supports the use of the label \(org.springframework.web.bind.annotation\) provided by Spring MVC to declare the REST interface, but the two are independent implementations and have different design goals. The goal of the java chassis is to provide a cross-language framework that supports multiple communication protocols. Therefore, some features of Spring MVC that are not very good for cross-language support are removed, and features that are strongly related to a specific running framework are not supported, such as direct access to the Servlet protocol definition. HttpServletRequest. Here are some notable differences. -Spring MVC使用@RestController声明服务,而java chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring MVC的标签还是使用JAX RS的标签。 +* Service declaration method + +Spring MVC uses @RestController to declare the service, and java chassis uses @RestSchema to declare the service and needs to display the service path using @RequestMapping to distinguish whether the service uses Spring MVC tags or JAX RS tags. ``` @RestSchema(schemaId = "hello") @RequestMapping(path = "/") ``` -Schema是java chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。 +The schema is the service contract of java chassis, which is the basis of service runtime. Service management, codec and so on are all based on contract. In a cross-language scenario, the contract also defines the parts of the language that can be understood simultaneously. -* 数据类型支持 +* Data type support -采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如: +With Spring MVC, you can use multiple data types in a service definition as long as it can be serialized and deserialized by json. Such as: ``` -// 抽象类型 -public void postData(@RequestBody Object data) -// 接口定义 -public void postData(@RequestBody IPerson interfaceData) -// 没指定类型的泛型 -public void postData(@RequestBody Map rawData) -// 具体协议相关的类型 -public void postData(HttpServletRequest rquest) +// abstract type +Public void postData(@RequestBody Object data) +// Interface definition +Public void postData(@RequestBody IPerson interfaceData) +// no generic type of the specified type Review comment: no generic type of the specified type 这个是机翻,直接generic type就可以了 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 #423: SCB-857 Provider rule of consumer can not be removed
coveralls 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-414895387 [![Coverage Status](https://coveralls.io/builds/18604400/badge)](https://coveralls.io/builds/18604400) Coverage decreased (-4.1%) to 72.036% when pulling **a0160686baf3d097db8bb9bf9f585da7b81a0451 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] zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211842895 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md ## @@ -1,73 +1,73 @@ -java chassis支持使用Spring MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。 -* 服务声明方式 +Java chassis supports the use of the label \(org.springframework.web.bind.annotation\) provided by Spring MVC to declare the REST interface, but the two are independent implementations and have different design goals. The goal of the java chassis is to provide a cross-language framework that supports multiple communication protocols. Therefore, some features of Spring MVC that are not very good for cross-language support are removed, and features that are strongly related to a specific running framework are not supported, such as direct access to the Servlet protocol definition. HttpServletRequest. Here are some notable differences. -Spring MVC使用@RestController声明服务,而java chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring MVC的标签还是使用JAX RS的标签。 +* Service declaration method + +Spring MVC uses @RestController to declare the service, and java chassis uses @RestSchema to declare the service and needs to display the service path using @RequestMapping to distinguish whether the service uses Spring MVC tags or JAX RS tags. ``` @RestSchema(schemaId = "hello") @RequestMapping(path = "/") ``` -Schema是java chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。 +The schema is the service contract of java chassis, which is the basis of service runtime. Service management, codec and so on are all based on contract. In a cross-language scenario, the contract also defines the parts of the language that can be understood simultaneously. -* 数据类型支持 +* Data type support -采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如: +With Spring MVC, you can use multiple data types in a service definition as long as it can be serialized and deserialized by json. Such as: ``` -// 抽象类型 -public void postData(@RequestBody Object data) -// 接口定义 -public void postData(@RequestBody IPerson interfaceData) -// 没指定类型的泛型 -public void postData(@RequestBody Map rawData) -// 具体协议相关的类型 -public void postData(HttpServletRequest rquest) +// abstract type +Public void postData(@RequestBody Object data) +// Interface definition +Public void postData(@RequestBody IPerson interfaceData) +// no generic type of the specified type Review comment: no generic type of the specified type 这个是机翻,直接generic type就可以了 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 `3.75%`. > The diff coverage is `42.55%`. [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/graphs/tree.svg?token=GAaF7zrg8R=pr=150=650)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423?src=pr=tree) ```diff @@Coverage Diff @@ ## master #423 +/- ## == - Coverage 72.97% 69.21% -3.76% == Files 128 139 +11 Lines997810770 +792 == + Hits 7281 7454 +173 - Misses 2221 2839 +618 - Partials 476 477 +1 ``` | [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==) | `66.21% <0%> (+3.71%)` | :arrow_up: | | [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/key\_generator.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL2NvcmUva2V5X2dlbmVyYXRvci5nbw==) | `14.71% <100%> (ø)` | | | [server/core/microservice.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvbWljcm9zZXJ2aWNlLmdv) | `76% <100%> (ø)` | | | [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/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/plugin/infra/registry/etcd/tracing.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-c2VydmVyL3BsdWdpbi9pbmZyYS9yZWdpc3RyeS9ldGNkL3RyYWNpbmcuZ28=) | `72.72% <0%> (-9.1%)` | :arrow_down: | | [pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/423/diff?src=pr=tree#diff-cGtnL3Rsc3V0aWwvdGxzdXRpbC5nbw==) | `73.58% <0%> (-0.95%)` | :arrow_down: | | ... and [14 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...a016068](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] zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211842210 ## File path: java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-between-java-web.md ## @@ -1,2 +1 @@ -两种开发方式都会启用java chassis的全量功能,JAVA应用方式运行于独立的HTTP服务器(基于vert.x构建)上,性能上存在很大的优势。Web开发方式运行于Tomcat或者其他内置的Web服务器之上,作为一个Servlet接收请求,因此在开发过程中,可以使用Web容器提供的一些功能,比如提供页面服务,使用Filter等。当应用只需要提供REST服务,并且对性能要求很高的场景,建议使用JAVA应用方式。 - +Both development methods will enable the full functionality of the java chassis. The JAVA application mode runs on a separate HTTP server (based on vert.x build), which has great advantages in performance. The web development method runs on Tomcat or other built-in web servers and receives requests as a servlet. Therefore, during the development process, you can use some functions provided by the web container, such as providing page services and using Filter. When the application only needs to provide REST services, and performance requirements are high, it is recommended to use a JAVA application. Review comment: 去掉build JAVA application - JAVA application mode 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211841963 ## File path: 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 to rely on it. * 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 to rely on it. * 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 to rely on it. * 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 methods". Review comment: Web development methods -> Web development mode 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211841888 ## File path: 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 to rely on it. * 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 to rely on it. * 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 to rely on it. * 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". Review comment: Web development method -> Web development mode 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 #40: Using java chassis in spring boot dir translation
zhengyangyong commented on a change in pull request #40: Using java chassis in spring boot dir translation URL: https://github.com/apache/incubator-servicecomb-docs/pull/40#discussion_r211841681 ## File path: 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 to rely on it. Review comment: rely -> depend 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] crystaldust opened a new pull request #263: Docs/debugging
crystaldust opened a new pull request #263: Docs/debugging URL: https://github.com/apache/incubator-servicecomb-saga/pull/263 Add the debug information in spring-demo's README file, and add references to it in other demo's documents. 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