[GitHub] [servicecomb-kie] zhulijian1 commented on a change in pull request #127: able to get key by id
zhulijian1 commented on a change in pull request #127: able to get key by id URL: https://github.com/apache/servicecomb-kie/pull/127#discussion_r398298103 ## File path: server/service/mongo/kv/kv_service.go ## @@ -210,36 +208,8 @@ func (s *Service) FindKV(ctx context.Context, domain string, project string, opt if project == "" { return nil, session.ErrMissingProject } - - if opts.ID != "" { - openlogging.Debug(MsgFindOneKeyByID, openlogging.WithTags(openlogging.Tags{ - "id": opts.ID, - "key":opts.Key, - "labels": opts.Labels, - })) - return findKVByID(ctx, domain, project, opts.ID) + if id == "" { + return nil, session.ErrIDIsNil } - - cur, _, err := findKV(ctx, domain, project, opts) - if err != nil { - return nil, err - } - defer cur.Close(ctx) - - if opts.Depth == 0 && opts.Key != "" { - openlogging.Debug(MsgFindOneKey, openlogging.WithTags( - map[string]interface{}{ - "key":opts.Key, - "label": opts.Labels, - "domain": domain, - }, - )) - return cursorToOneKV(ctx, cur, opts.Labels) Review comment: cursorToOneKV函数应该没有别处调用了吧,没的话就删了吧 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] Caixinyang commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
Caixinyang commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663#issuecomment-604205977 那请问,java-chassis是否有测试接口的类,类似mockmvc这样的工具。模拟restful请求。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] zhufeizzz commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
zhufeizzz commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604199014 @liubao68 因为CSE和SpringMVC是分别编写的,很难控制命名冲突,比如同样一个用户创建的接口,CSE和SpringMVC可能都叫/user/create,目前的规避措施是SpringMVC全都加上一层前缀,如:/web/user/create,但体验就比较差了。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604197570 按照你说的, 应该是 spring MVC 自己加载了下面的两个类作为 Controller。 我发的配置项只控制 java-chassis 不加载 `@RestController`。 需要像个办法让 spring MVC 不加载 `@RestSchema` , 否则只能避免名字冲突了。 ``` @RestSchema(schemaId = "RepeatServiceA") @RequestMapping(path = "/rest/repeat-a") public class RepeatService @RestController("RepeatServiceB") @RequestMapping(path = "/rest/repeat-a") public class RepeatService ``` BWT: 实际应用场景需要 RepeatServiceA 和 RepeatServiceB 有一样的 url 吗? 感觉这个是个错误。 是不是 "/rest/repeat-b"? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] zhufeizzz commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
zhufeizzz commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604192165 @liubao68 你说的这个配置已经添加,问题的原因是SpringMVC会扫描到RestSchema类,并通过此方法判断`org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#isHandler`,因为用到的RequestMapping注解,所以被扫描到。 ``` protected boolean isHandler(Class beanType) { return (AnnotatedElementUtils.hasAnnotation(beanType, Controller.class) || AnnotatedElementUtils.hasAnnotation(beanType, RequestMapping.class)); } ``` 完整错误日志如下: ``` [2020-03-26 10:20:35,366]-[]-[]-[main]-[org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:826)]-[ERROR] Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'RepeatServiceA' method com.huawei.mateinfo.demo.repeat.controller.a.RepeatService#hello() to {GET /rest/repeat-a/hello}: There is already 'repeatService' bean method com.huawei.mateinfo.demo.repeat.api.a.RepeatService#hello() mapped. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1803) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.1.RELEASE.jar:2.2.1.RELEASE] at com.huawei.mateinfo.demo.SDKDemoApplication.main(SDKDemoApplication.java:16) [classes/:?] Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'RepeatServiceA' method com.huawei.mateinfo.demo.repeat.controller.a.RepeatService#hello() to {GET /rest/repeat-a/hello}: There is already 'repeatService' bean method com.huawei.mateinfo.demo.repeat.api.a.RepeatService#hello() mapped. at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.validateMethodMapping(AbstractHandlerMethodMapping.java:633) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:600) ~[spring-webmvc-5.2.1.RELEASE.jar:5.2.1.RELEASE] at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:318)
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
liubao68 edited a comment on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663#issuecomment-604179612 `ProducerOperationHandler` 是 java-chassis 的类。 不过看你的异常堆栈,不像是 java-chassis 抛出的异常, 处理过程不是 java-chassis 的处理过程。 我没用过你说的 mock 工具, 可能这个工具自己 mock 了一个 HTTP 服务器, 并不是走的 java-chassis. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
liubao68 commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663#issuecomment-604179612 `ProducerOperationHandler` 是 java-chassis 的类。 不过看你的异常堆栈,不像是 java-chassis 抛出的异常, 处理过程不是 java-chassis 的处理过程。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径?
liubao68 edited a comment on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径? URL: https://github.com/apache/servicecomb-java-chassis/issues/1612#issuecomment-604178273 [BMI 例子](https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples/bmi) 里面有配置。 就是你发的: ``` gateway: webroot: /code/servicecomb-samples/java-chassis-samples/bmi/webapp/src/main/resources/static ``` 这个是windows配置, linux配置的话,只能用相对路径 你也可以尝试修改代码 [StaticWebpageDispatcher](https://github.com/apache/servicecomb-samples/blob/master/java-chassis-samples/bmi/webapp/src/main/java/org/apache/servicecomb/samples/bmi/StaticWebpageDispatcher.java) 提供更好的配置方法。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径?
liubao68 edited a comment on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径? URL: https://github.com/apache/servicecomb-java-chassis/issues/1612#issuecomment-604178273 [BMI 例子](https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples/bmi) 里面有配置。 就是你发的: ``` gateway: webroot: /code/servicecomb-samples/java-chassis-samples/bmi/webapp/src/main/resources/static ``` 这个是windows配置, linux配置的话,只能用相对路径 你也可以尝试修改代码 [StaticWebpageDispatcher] (https://github.com/apache/servicecomb-samples/blob/master/java-chassis-samples/bmi/webapp/src/main/java/org/apache/servicecomb/samples/bmi/StaticWebpageDispatcher.java) 提供更好的配置方法。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径?
liubao68 commented on issue #1612: bmi/webapp 这里sample如何启动,webroot是不是需要配置static的绝对路径? URL: https://github.com/apache/servicecomb-java-chassis/issues/1612#issuecomment-604178273 [BMI 例子](https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples/bmi) 里面有配置。 就是你发的: ``` gateway: webroot: /code/servicecomb-samples/java-chassis-samples/bmi/webapp/src/main/resources/static ``` 这个是windows配置, linux配置的话,只能用相对路径 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604177277 这个异常没碰到过,可能需要具体看看是什么情况下,哪个组件抛出来的, 可以提供下详细的错误堆栈。 也可以加上`servicecomb.provider.rest.scanRestController=false` 试试。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604177277 这个异常没碰到过,可能需要具体看看是什么情况下,哪个组件抛出来的, 可以提供下详细的错误堆栈。 也可以加上`servicecomb.provider.rest.scanRestController` 试试。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 commented on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604177277 这个异常没碰到过,可能需要具体看看是申请情况下,哪个组件抛出来的。 也加上`servicecomb.provider.rest.scanRestController` 试试。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604177277 这个异常没碰到过,可能需要具体看看是什么情况下,哪个组件抛出来的。 也加上`servicecomb.provider.rest.scanRestController` 试试。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突
liubao68 edited a comment on issue #1622: 跟SpringMVC共用的时候会存在路径冲突 URL: https://github.com/apache/servicecomb-java-chassis/issues/1622#issuecomment-604177277 这个异常没碰到过,可能需要具体看看是什么情况下,哪个组件抛出来的。 也可以加上`servicecomb.provider.rest.scanRestController` 试试。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1650: TLS传输明文配置私钥口令
liubao68 commented on issue #1650: TLS传输明文配置私钥口令 URL: https://github.com/apache/servicecomb-java-chassis/issues/1650#issuecomment-604176231 你可以自定义 `ssl.sslCustomClass` , 然后提供加密解密措施。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1662: servicecomb启动报空指针异常
liubao68 commented on issue #1662: servicecomb启动报空指针异常 URL: https://github.com/apache/servicecomb-java-chassis/issues/1662#issuecomment-604175975 你用的哪个版本? 可以对着代码看看失败代码上下文, 也可以看看更前面的日志,可能是启动过程中其他异常导致的。 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] Caixinyang commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
Caixinyang commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663#issuecomment-604174394 1、程序正常启动,API调用是可以正常进入ExceptionToProducerResponseConverter 2、测试用例使用mockmvc执行则进不去,请问怎么看这个ProducerOperationHandler,controller的入口打点捕捉不到异常? ![image](https://user-images.githubusercontent.com/30398258/77600601-5fdc8180-6f43-11ea-9c70-0135f80e2edb.png) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-kie] branch master updated: fix status don't update (#125)
This is an automated email from the ASF dual-hosted git repository. tianxiaoliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-kie.git The following commit(s) were added to refs/heads/master by this push: new feeacdf fix status don't update (#125) feeacdf is described below commit feeacdfa33c65de0a2830f07e72f42a90e930c84 Author: GuoYL <53255576+guoyl...@users.noreply.github.com> AuthorDate: Thu Mar 26 09:21:38 2020 +0800 fix status don't update (#125) * fix status/value_type don't update * modify unit test * delete value_type --- server/resource/v1/history_resource_test.go | 7 +++ server/service/mongo/kv/kv_dao.go | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/resource/v1/history_resource_test.go b/server/resource/v1/history_resource_test.go index 82d6d2b..63614a9 100644 --- a/server/resource/v1/history_resource_test.go +++ b/server/resource/v1/history_resource_test.go @@ -90,8 +90,8 @@ func TestHistoryResource_GetPollingData(t *testing.T) { t.Run("list kv by service label, to create a polling data", func(t *testing.T) { r, _ := http.NewRequest("GET", "/v1/test/kie/kv", nil) noopH := {} - noopH2 := {} - chain, _ := handler.CreateChain(common.Provider, "testchain3", noopH.Name(), noopH2.Name()) + trackH := {} + chain, _ := handler.CreateChain(common.Provider, "testchain3", noopH.Name(), trackH.Name()) r.Header.Set("Content-Type", "application/json") r.Header.Set("X-Session-Id", "test") kvr := {} @@ -108,8 +108,7 @@ func TestHistoryResource_GetPollingData(t *testing.T) { t.Run("get polling data", func(t *testing.T) { r, _ := http.NewRequest("GET", "/v1/test/kie/track?sessionId=test", nil) noopH := {} - track := handler2.TrackHandler{} - chain, _ := handler.CreateChain(common.Provider, "testchain3", noopH.Name(), track.Name()) + chain, _ := handler.CreateChain(common.Provider, "testchain3", noopH.Name()) r.Header.Set("Content-Type", "application/json") revision := {} c, err := restfultest.New(revision, chain) diff --git a/server/service/mongo/kv/kv_dao.go b/server/service/mongo/kv/kv_dao.go index 059264c..0b3a49c 100644 --- a/server/service/mongo/kv/kv_dao.go +++ b/server/service/mongo/kv/kv_dao.go @@ -82,6 +82,7 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc) error { ur, err := collection.UpdateOne(ctx, bson.M{"key": kv.Key, "label_id": kv.LabelID}, bson.D{ {"$set", bson.D{ {"value", kv.Value}, + {"status", kv.Status}, {"checker", kv.Checker}, {"update_revision", kv.UpdateRevision}, }},
[GitHub] [servicecomb-kie] tianxiaoliang merged pull request #125: fix status don't update
tianxiaoliang merged pull request #125: fix status don't update URL: https://github.com/apache/servicecomb-kie/pull/125 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
liubao68 commented on issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663#issuecomment-604171463 可以先检查下异常从哪里抛出。 如果你使用的最新版本, 可以看看 ProducerOperationHandler 的 doInvoke 方法,是否异常从这里抛出,如果不是, 则不会走 `ExceptionToProducerResponseConverter` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r398261445 ## File path: pkg/model/db_schema.go ## @@ -31,19 +31,19 @@ type LabelDoc struct { type KVDoc struct { ID string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"` LabelIDstring `json:"label_id,omitempty" bson:"label_id,omitempty" yaml:"label_id,omitempty"` - Keystring `json:"key" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties - Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script + Keystring `json:"key" yaml:"key" validate:"kieKey"` + Value string `json:"value,omitempty" yaml:"value,omitempty" validate:"ascii,min=1,max=2097152"` + ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty" validate:"kieValueType"` //ini,json,text,yaml,properties Review comment: 已修改 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r398261391 ## File path: pkg/model/db_schema.go ## @@ -31,19 +31,19 @@ type LabelDoc struct { type KVDoc struct { ID string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"` LabelIDstring `json:"label_id,omitempty" bson:"label_id,omitempty" yaml:"label_id,omitempty"` - Keystring `json:"key" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties - Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script + Keystring `json:"key" yaml:"key" validate:"kieKey"` Review comment: 已修改 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r398261315 ## File path: pkg/validate/instance.go ## @@ -0,0 +1,37 @@ +package validate + +import "github.com/go-mesh/openlogging" + +var defaultValidator *Validator + +// custom validate rules +// tag names suggested to be "kie*", to distinguish from third party tags +var customRules = []*RegexValidateRule{ + NewRule("kieKey", `^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, {Min: 1, Max: 256}), + NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, nil), Review comment: 已修改,正则允许为空 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-fence] liubao68 commented on issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport
liubao68 commented on issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport URL: https://github.com/apache/servicecomb-fence/issues/24#issuecomment-604169513 I'll upgrade this project to using 2.0.0 soon This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-fence] liubao68 commented on issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport
liubao68 commented on issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport URL: https://github.com/apache/servicecomb-fence/issues/24#issuecomment-604169316 check [升级指南](https://docs.servicecomb.io/java-chassis/zh_CN/featured-topics/upgrading/1_3_0T2_0_0/) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] GuoYL123 commented on a change in pull request #125: fix status don't update
GuoYL123 commented on a change in pull request #125: fix status don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r398260063 ## File path: server/resource/v1/history_resource_test.go ## @@ -90,8 +90,8 @@ func TestHistoryResource_GetPollingData(t *testing.T) { t.Run("list kv by service label, to create a polling data", func(t *testing.T) { r, _ := http.NewRequest("GET", "/v1/test/kie/kv", nil) noopH := {} - noopH2 := {} Review comment: 这是删掉的代码,新增的已经修改了 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-pack] coveralls commented on issue #641: [SCB-1811] Configure PAYLOADS_MAX_LENGTH parameter from os environment
coveralls commented on issue #641: [SCB-1811] Configure PAYLOADS_MAX_LENGTH parameter from os environment URL: https://github.com/apache/servicecomb-pack/pull/641#issuecomment-603964107 [![Coverage Status](https://coveralls.io/builds/29612007/badge)](https://coveralls.io/builds/29612007) Coverage remained the same at 80.858% when pulling **4387a2c610d8282fc1668182b79e459e3a42916a on coolbeevip:SCB-1811** into **97b95589184381b56c7ba37e301ce1c077547f0d on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-pack] coolbeevip opened a new pull request #641: [SCB-1811] Configure PAYLOADS_MAX_LENGTH parameter from os environment
coolbeevip opened a new pull request #641: [SCB-1811] Configure PAYLOADS_MAX_LENGTH parameter from os environment URL: https://github.com/apache/servicecomb-pack/pull/641 Configure PAYLOADS_MAX_LENGTH parameter from os environment variables This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-service-center] coveralls edited a comment on issue #636: [SCB-1789] [Syncer] Use etcd option to optimize dependencies
coveralls edited a comment on issue #636: [SCB-1789] [Syncer] Use etcd option to optimize dependencies URL: https://github.com/apache/servicecomb-service-center/pull/636#issuecomment-591487512 [![Coverage Status](https://coveralls.io/builds/29610239/badge)](https://coveralls.io/builds/29610239) Coverage increased (+0.2%) to 60.597% when pulling **9e8fec3e9a52e1f9a30e7e5f66d01ffc4ff556fa on ChinX:syncer-etcd** into **ab569eda67981a813942b1b92e7b2be099ba5519 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-service-center] branch master updated: Change moduleServer interface definition to simplify code
This is an automated email from the ASF dual-hosted git repository. zenlin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git The following commit(s) were added to refs/heads/master by this push: new ab569ed Change moduleServer interface definition to simplify code ab569ed is described below commit ab569eda67981a813942b1b92e7b2be099ba5519 Author: chinxââ AuthorDate: Tue Mar 24 23:05:59 2020 +0800 Change moduleServer interface definition to simplify code --- syncer/etcd/agent.go| 14 +++--- syncer/grpc/server.go | 14 +++--- syncer/pkg/mock/mocksotrage/etcd.go | 7 +++ syncer/serf/agent.go| 31 +++ syncer/server/server.go | 15 ++- 5 files changed, 34 insertions(+), 47 deletions(-) diff --git a/syncer/etcd/agent.go b/syncer/etcd/agent.go index a52a511..c0607a3 100644 --- a/syncer/etcd/agent.go +++ b/syncer/etcd/agent.go @@ -32,7 +32,7 @@ type Agent struct { conf*Config etcd*embed.Etcd readyCh chan struct{} - errorCh chan error + stopCh chan struct{} } // NewAgent new etcd agent with config @@ -40,7 +40,7 @@ func NewAgent(conf *Config) *Agent { return { conf:conf, readyCh: make(chan struct{}), - errorCh: make(chan error), + stopCh: make(chan struct{}), } } @@ -62,13 +62,13 @@ func (a *Agent) Start(ctx context.Context) { // Returns an error when running goroutine fails in the etcd startup process case err = <-etcd.Err(): case <-ctx.Done(): - err = ctx.Err() + err = errors.New("cancel etcd server from context") } } if err != nil { log.Error("start etcd failed", err) - a.errorCh <- err + close(a.stopCh) } } @@ -77,9 +77,9 @@ func (a *Agent) Ready() <-chan struct{} { return a.readyCh } -// Error Returns a channel that will be transmit an etcd error -func (a *Agent) Error() <-chan error { - return a.errorCh +// Error Returns a channel that will be closed when etcd is stopped +func (a *Agent) Stopped() <-chan struct{} { + return a.stopCh } // Storage returns etcd storage diff --git a/syncer/grpc/server.go b/syncer/grpc/server.go index 53007c5..f9aa83f 100644 --- a/syncer/grpc/server.go +++ b/syncer/grpc/server.go @@ -40,7 +40,7 @@ type Server struct { addrstring handler GRPCHandler readyCh chan struct{} - errorCh chan error + stopCh chan struct{} tlsConf *tls.Config } @@ -50,7 +50,7 @@ func NewServer(addr string, handler GRPCHandler, tlsConf *tls.Config) *Server { addr:addr, handler: handler, readyCh: make(chan struct{}), - errorCh: make(chan error), + stopCh: make(chan struct{}), tlsConf: tlsConf, } } @@ -75,7 +75,7 @@ func (s *Server) Start(ctx context.Context) { var svc *grpc.Server if s.tlsConf != nil { svc = grpc.NewServer(grpc.Creds(credentials.NewTLS(s.tlsConf))) - }else{ + } else { svc = grpc.NewServer() } @@ -88,7 +88,7 @@ func (s *Server) Start(ctx context.Context) { if err != nil { log.Error("start grpc failed", err) - s.errorCh <- err + close(s.stopCh) return } log.Info("start grpc success") @@ -100,7 +100,7 @@ func (s *Server) Ready() <-chan struct{} { return s.readyCh } -// Error Returns a channel that will be transmit a grpc error -func (s *Server) Error() <-chan error { - return s.errorCh +// Error Returns a channel that will be closed a grpc is stopped +func (s *Server) Stopped() <-chan struct{} { + return s.stopCh } diff --git a/syncer/pkg/mock/mocksotrage/etcd.go b/syncer/pkg/mock/mocksotrage/etcd.go index 3604a16..576af19 100644 --- a/syncer/pkg/mock/mocksotrage/etcd.go +++ b/syncer/pkg/mock/mocksotrage/etcd.go @@ -19,6 +19,7 @@ package mocksotrage import ( "context" + "errors" "fmt" "net/url" "os" @@ -42,10 +43,8 @@ func NewKVServer() (svr *MockServer, err error) { go agent.Start(context.Background()) select { case <-agent.Ready(): - case err = <-agent.Error(): - } - if err != nil { - return nil, err + case <-agent.Stopped(): + return nil, errors.New("start etcd mock server failed") } return {agent}, nil } diff --git a/syncer/serf/agent.go b/syncer/serf/agent.go index f1b2e28..59a9d0a 100644 --- a/syncer/serf/agent.go +++
[GitHub] [servicecomb-service-center] zenlint merged pull request #635: [SCB-1788] [Syncer] Change moduleServer interface definition to simplify code
zenlint merged pull request #635: [SCB-1788] [Syncer] Change moduleServer interface definition to simplify code URL: https://github.com/apache/servicecomb-service-center/pull/635 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397913599 ## File path: pkg/validate/validator_test.go ## @@ -0,0 +1,36 @@ +package validate_test + +import ( + "testing" + + "github.com/apache/servicecomb-kie/pkg/validate" + "github.com/stretchr/testify/assert" +) + +type student struct { + Namestring `validate:"kieTest"` Review comment: instance_test.go用真实业务模型做了测试 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-service-center] zenlint commented on issue #635: [SCB-1788] [Syncer] Change moduleServer interface definition to simplify code
zenlint commented on issue #635: [SCB-1788] [Syncer] Change moduleServer interface definition to simplify code URL: https://github.com/apache/servicecomb-service-center/pull/635#issuecomment-603880221 LGTM This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397901317 ## File path: cmd/kieserver/main.go ## @@ -94,6 +96,9 @@ func main() { if err := service.DBInit(); err != nil { openlogging.Fatal(err.Error()) } + if err := validate.Init(); err != nil { + openlogging.Fatal("Validate init failed: " + err.Error()) Review comment: go日志小写开头 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397902825 ## File path: server/resource/v1/kv_resource.go ## @@ -49,9 +51,9 @@ func (r *KVResource) Put(context *restful.Context) { kv.Key = key kv.Domain = domain.(string) kv.Project = project - _, err = checkStatus(kv.Status) + err = validate.Validate(kv) if err != nil { - WriteErrResponse(context, http.StatusInternalServerError, err.Error(), common.ContentTypeText) + WriteErrResponse(context, http.StatusBadRequest, err.Error(), common.ContentTypeText) Review comment: 似乎不是text型返回,我记得是json This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] coveralls commented on issue #1664: [SCB-1822]fix problems when using multiple consumer interface for one…
coveralls commented on issue #1664: [SCB-1822]fix problems when using multiple consumer interface for one… URL: https://github.com/apache/servicecomb-java-chassis/pull/1664#issuecomment-603858929 [![Coverage Status](https://coveralls.io/builds/29607476/badge)](https://coveralls.io/builds/29607476) Coverage increased (+0.01%) to 84.998% when pulling **478643f1f8ce88ba7edbe76af108d12144d2e678 on liubao68:release** into **6cef5feb94807a246611dc213ba23512def06dc6 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1665: [SCB-1825] client outlog: rename item and delete README.md
liubao68 merged pull request #1665: [SCB-1825] client outlog: rename item and delete README.md URL: https://github.com/apache/servicecomb-java-chassis/pull/1665 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-java-chassis] branch master updated: [SCB-1825] client outlog: rename item and delete README.md (#1665)
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/servicecomb-java-chassis.git The following commit(s) were added to refs/heads/master by this push: new 7ad8046 [SCB-1825] client outlog: rename item and delete README.md (#1665) 7ad8046 is described below commit 7ad804699ee9a7a1ff06515657b470b882b23b90 Author: heyile <2513931...@qq.com> AuthorDate: Wed Mar 25 21:22:50 2020 +0800 [SCB-1825] client outlog: rename item and delete README.md (#1665) --- .../servicecomb/common/accessLog/core/README.md| 373 - ...ss.java => ConfigurableDatetimeAccessItem.java} | 6 +- ...CookieItemAccess.java => CookieAccessItem.java} | 4 +- ...ess.java => DurationMillisecondAccessItem.java} | 2 +- ...emAccess.java => DurationSecondAccessItem.java} | 2 +- ...cess.java => FirstLineOfRequestAccessItem.java} | 8 +- ...odItemAccess.java => HttpMethodAccessItem.java} | 2 +- ...usItemAccess.java => HttpStatusAccessItem.java} | 4 +- ...ccess.java => InvocationContextAccessItem.java} | 4 +- ...ostItemAccess.java => LocalHostAccessItem.java} | 2 +- ...ortItemAccess.java => LocalPortAccessItem.java} | 2 +- ...extItemAccess.java => PlainTextAccessItem.java} | 4 +- ...gItemAccess.java => QueryStringAccessItem.java} | 2 +- ...stItemAccess.java => RemoteHostAccessItem.java} | 2 +- ...temAccess.java => RequestHeaderAccessItem.java} | 4 +- ...mAccess.java => RequestProtocolAccessItem.java} | 2 +- ...emAccess.java => ResponseHeaderAccessItem.java} | 4 +- ...ItemAccess.java => ResponseSizeAccessItem.java} | 4 +- ...aceIdItemAccess.java => TraceIdAccessItem.java} | 8 +- ...ortItemAccess.java => TransportAccessItem.java} | 2 +- ...lPathItemAccess.java => UrlPathAccessItem.java} | 2 +- ...Access.java => UrlPathWithQueryAccessItem.java} | 2 +- .../core/parser/AccessLogItemCreator.java | 4 +- ...DefaultCompositeVertxRestAccessLogItemMeta.java | 86 ++--- .../impl/VertxRestAccessLogPatternParser.java | 10 +- .../accessLog/core/AccessLogGeneratorTest.java | 30 +- .../core/element/impl/CookieItemTest.java | 2 +- .../element/impl/DatetimeConfigurableItemTest.java | 32 +- .../element/impl/DurationMillisecondItemTest.java | 2 +- .../core/element/impl/DurationSecondItemTest.java | 2 +- .../element/impl/FirstLineOfRequestItemTest.java | 2 +- .../core/element/impl/HttpMethodItemTest.java | 2 +- .../core/element/impl/HttpStatusItemTest.java | 2 +- .../element/impl/InvocationContextItemTest.java| 16 +- .../core/element/impl/LocalHostItemTest.java | 12 +- .../core/element/impl/LocalPortItemTest.java | 2 +- .../core/element/impl/PlainTextItemTest.java | 4 +- .../core/element/impl/QueryStringItemTest.java | 2 +- .../core/element/impl/RemoteHostItemTest.java | 2 +- .../core/element/impl/RequestHeaderItemTest.java | 2 +- .../core/element/impl/RequestProtocolItemTest.java | 2 +- .../core/element/impl/ResponseHeaderItemTest.java | 2 +- .../core/element/impl/ResponseSizeItemTest.java| 2 +- .../core/element/impl/TraceIdItemTest.java | 2 +- .../core/element/impl/TransportItemTest.java | 2 +- .../core/element/impl/UrlPathItemTest.java | 2 +- .../element/impl/UrlPathWithQueryItemTest.java | 2 +- ...sLogItem.java => UserDefinedAccessLogItem.java} | 4 +- ...va => UserDefinedAccessLogItemLowPriority.java} | 4 +- ...=> TestCompositeExtendedAccessLogItemMeta.java} | 6 +- ...va => TestSingleExtendedAccessLogItemMeta.java} | 8 +- .../impl/VertxRestAccessLogPatternParserTest.java | 154 - ...ccessLog.core.parser.VertxRestAccessLogItemMeta | 4 +- .../transport/rest/vertx/RestServerVerticle.java | 4 +- 54 files changed, 242 insertions(+), 615 deletions(-) diff --git a/common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/README.md b/common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/README.md deleted file mode 100644 index 7b631e0..000 --- a/common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/README.md +++ /dev/null @@ -1,373 +0,0 @@ -## 概念阐述 - -ServiceComb提供了基于Vert.x的access log 和 request log功能。当用户使用REST over Vertx通信方式时,可以通过简单的配置启用access log打印功能。当用户 client 端进行远程调用时,可以通过简单的配置启用request log打印功能 - -## 场景描述 - -1. 用户在调试服务时可能需要开启access log。在使用REST over servlet通信方式的情况下,可以使用web容器的access log功能;而在使用REST over Vertx通信方式的情况下,可以使用ServiceComb提供的一套access log功能。 - -2. 用户想要跟踪,记录客户端远程调用信息, 可以开启 request log。request log 同时支持记录 rest 和 highway 远程调用方式。 - -## 配置说明 - -### 启用Access Log and Request Log - -用户需要在microservice.yaml文件中增加配置以启用access log 和 request log,配置示例如下: - -```yaml -servicecomb: - accesslog: -enabled: true ## server 端 启用access log -pattern: "%h - - %t %r %s %B %D" ## server 端
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1665: [SCB-1825] client outlog: rename item and delete README.md
liubao68 commented on issue #1665: [SCB-1825] client outlog: rename item and delete README.md URL: https://github.com/apache/servicecomb-java-chassis/pull/1665#issuecomment-603835710 I created a new issue to track this refactoring and the old is already closed in previous version. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-docs] branch master updated: [SCB-1820] add doc of request log and fixes some problems: modify as review
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/servicecomb-docs.git The following commit(s) were added to refs/heads/master by this push: new 5c9eb81 [SCB-1820] add doc of request log and fixes some problems: modify as review 5c9eb81 is described below commit 5c9eb819916dd5aea63753196e90426f45ad0d77 Author: heyile <2513931...@qq.com> AuthorDate: Wed Mar 25 14:52:20 2020 +0800 [SCB-1820] add doc of request log and fixes some problems: modify as review --- .../build-provider/access-log-configuration.md | 106 ++--- .../zh_CN/docs/build-provider/jaxrs.md | 38 .../zh_CN/docs/build-provider/springmvc.md | 40 3 files changed, 98 insertions(+), 86 deletions(-) diff --git a/java-chassis-reference/zh_CN/docs/build-provider/access-log-configuration.md b/java-chassis-reference/zh_CN/docs/build-provider/access-log-configuration.md index 37ab54c..d1bd839 100644 --- a/java-chassis-reference/zh_CN/docs/build-provider/access-log-configuration.md +++ b/java-chassis-reference/zh_CN/docs/build-provider/access-log-configuration.md @@ -1,18 +1,18 @@ ## 概念阐述 -ServiceComb提供了基于Vert.x的access log 和 request log功能。当用户使用REST over Vertx通信方式时,可以通过简单的配置启用access log打印功能。当用户 client 端进行远程调用时,可以通过简单的配置启用request log打印功能 +ServiceComb 提供了基于 Vert.x 的 access log 和 request log 功能。当用户使用 REST over Vertx 通信方式时,可以通过简单的配置启用 access log 打印功能。当用户 client 端进行远程调用时,可以通过简单的配置启用 request log 打印功能 ## 场景描述 -1. 用户在调试服务时可能需要开启access log。在使用REST over servlet通信方式的情况下,可以使用web容器的access log功能;而在使用REST over Vertx通信方式的情况下,可以使用ServiceComb提供的一套access log功能。 +1. 用户在调试服务时可能需要开启 access log。在使用 REST over servlet 通信方式的情况下,可以使用 web容器 的 access log 功能;而在使用 REST over Vertx 通信方式的情况下,可以使用 ServiceComb 提供的一套 access log 功能。 2. 用户想要跟踪,记录客户端远程调用信息, 可以开启 request log。request log 同时支持记录 rest 和 highway 远程调用方式。 ## 配置说明 -### 启用Access Log and Request Log +### 启用 Access Log & Request Log -用户需要在microservice.yaml文件中增加配置以启用access log 和 request log,配置示例如下: +用户需要在 microservice.yaml 文件中增加配置以启用 access log 和 request log,配置示例如下: ```yaml servicecomb: @@ -74,7 +74,7 @@ _**日志元素说明表(ServiceComb)**_ | Invocation Context | %{VARNAME}SCB-ctx | 打印key为`VARNAME`的invocation context值,找不到则打印"-" | | Transport Method | %SCB-transport | 打印当前调用的 **transport method** 。 `rest` 或者 `highway`| -_**Access log 与 Request log的日志元素对比**_ +_**Access log 与 Request log 的日志元素对比**_ | 元素名称 | Apache日志格式 | access log |access log 说明 | request log | request log说明 | | --- | --- | --- | --- | --- | --- | @@ -105,7 +105,7 @@ _**Access log 与 Request log的日志元素对比**_ ### 日志输出文件配置 -Access log的日志打印实现框架默认采用Log4j,并提供了一套默认的日志文件配置。用户可以在自己定义的log4j.properties文件中覆写这些配置。用户可配置的日志文件配置项见下表。 +Access log & Request log 的日志打印实现框架默认采用 Log4j ,并提供了一套默认的日志文件配置。用户可以在自己定义的 log4j.properties 文件中覆写这些配置。用户可配置的日志文件配置项见下表。 _**日志文件配置项**_ @@ -123,15 +123,15 @@ _**日志文件配置项**_ | log4j.appender.request.logPermission | rw--- | 日志文件权限 | - | > _**注意:**_ -> 由于ServiceComb的日志打印功能只依赖slf4j的接口,因此用户可以选择其他日志打印框架,选择其他日志打印框架时需要用户自行配置日志文件输出选项。 +> 由于 ServiceComb 的日志打印功能只依赖 slf4j 的接口,因此用户可以选择其他日志打印框架,选择其他日志打印框架时需要用户自行配置日志文件输出选项。 -### 日志实现框架切换为logback +### 日志实现框架切换为 logback -> 针对采用logback作为日志打印框架的项目,需要将日志打印框架依赖从Log4j改为logback并添加部分配置以使access log功能正常生效。 +> 针对采用 logback 作为日志打印框架的项目,需要将日志打印框架依赖从 Log4j 改为 logback 并添加部分配置以使 log 功能正常生效。 - 1. 排除Log4j依赖 + 1. 排除 Log4j 依赖 -在将日志实现框架切换为logback之前,需要检查项目的依赖,从中排除掉Log4j相关的依赖项。在项目中运行maven命令`dependency:tree`,找出其中依赖了Log4j的ServiceComb组件,在其``依赖项中添加如下配置: +在将日志实现框架切换为 logback 之前,需要检查项目的依赖,从中排除掉 Log4j 相关的依赖项。在项目中运行 maven 命令 `dependency:tree` ,找出其中依赖了Log4j的ServiceComb组件,在其``依赖项中添加如下配置: ```xml @@ -140,9 +140,9 @@ _**日志文件配置项**_ ``` - 2. 添加logback依赖 + 2. 添加 logback 依赖 -在pom文件中添加logback的依赖项: +在 pom 文件中添加 logback 的依赖项: ```xml @@ -159,9 +159,9 @@ _**日志文件配置项**_ ``` - 3. 配置access log & request log 组件的logger + 3. 配置 access log & request log 组件的 logger -由于ServiceComb提供的日志打印组件是获取名为`accesslog` & `requestlog` 的logger来打印access log 和 request log ,因此将日志实现框架从Log4j切换为logback的关键就是提供一个名为`accesslog` & `requestlog` 的 Logger,并为其配置好日志输出文件。以下是 **access log** & **request log** 在logback配置文件中的配置示例(本示例仅展示access log & request log相关的配置,其他日志配置均省略): +ServiceComb 提供的日志打印组件是获取名为 `accesslog` & `requestlog` 的 logger 来打印 access log 和 request log ,因此将日志实现框架从 Log4j 切换为 logback 的关键就是提供一个名为 `accesslog` & `requestlog` 的 Logger,并为其配置好日志输出文件。以下是 **access log** & **request log** 在 logback 配置文件中的配置示例(本示例仅展示 access log & request log相关的配置,其他日志配置均省略): ```xml @@ -200,9 +200,9 @@ _**日志文件配置项**_ ``` -### 自定义扩展Access Log & Request Log +### 自定义扩展 Access Log & Request Log -用户可以利用ServiceComb提供的AccessLogItem扩展机制,定制自己的AccessLogItem, 我们把 Request Log 也当做一种 Access Log。 +用户可以利用 ServiceComb 提供的 AccessLogItem 扩展机制,定制自己的 AccessLogItem, 我们把 Request Log 也当做一种 Access Log。 相关类说明 @@ -224,12 +224,12 @@
[GitHub] [servicecomb-docs] liubao68 merged pull request #155: [SCB-1820] add doc of request log and fixes some problems: modify as …
liubao68 merged pull request #155: [SCB-1820] add doc of request log and fixes some problems: modify as … URL: https://github.com/apache/servicecomb-docs/pull/155 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397799086 ## File path: pkg/validate/instance.go ## @@ -0,0 +1,37 @@ +package validate + +import "github.com/go-mesh/openlogging" + +var defaultValidator *Validator + +// custom validate rules +// tag names suggested to be "kie*", to distinguish from third party tags +var customRules = []*RegexValidateRule{ + NewRule("kieKey", `^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, {Min: 1, Max: 256}), + NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, nil), + NewRule("kieKvStatus", `^(enabled|disabled){0,1}$`, nil), Review comment: 正则允许为空 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] humingcheng commented on a change in pull request #124: Support parameter validation
humingcheng commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397796526 ## File path: go.mod ## @@ -6,8 +6,11 @@ require ( github.com/go-chassis/go-chassis v0.0.0-20200322084331-36849ab2cb10 github.com/go-chassis/paas-lager v1.1.1 github.com/go-mesh/openlogging v1.0.1 + github.com/go-playground/universal-translator v0.17.0 + github.com/go-playground/validator v9.29.0+incompatible Review comment: v10的版本通过goproxy下载不下来,没办法 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-pack] WillemJiang commented on issue #639: omega端报Failed to process grpc coordinate command,alpha端报io.grpc.StatusRuntimeException: CANCELLED: call already cancelled
WillemJiang commented on issue #639: omega端报Failed to process grpc coordinate command,alpha端报io.grpc.StatusRuntimeException: CANCELLED: call already cancelled URL: https://github.com/apache/servicecomb-pack/issues/639#issuecomment-603795073 @lostpillow 有什么进展吗? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-pack] 02/06: SCB-1735 Catch the compensation method timeout exception and send a CompensateAckTimeoutEvent event and record
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/servicecomb-pack.git commit 2d98d6b2c0b17274c5a6af82a5946ff4ce860450 Author: Lei Zhang AuthorDate: Sat Mar 21 22:12:21 2020 +0800 SCB-1735 Catch the compensation method timeout exception and send a CompensateAckTimeoutEvent event and record --- .../event/internal/CompensateAckTimeoutEvent.java | 86 ++ .../servicecomb/pack/alpha/fsm/SagaActor.java | 44 +-- .../pack/alpha/fsm/domain/UpdateTxEventDomain.java | 9 +++ 3 files changed, 132 insertions(+), 7 deletions(-) diff --git a/alpha/alpha-core/src/main/java/org/apache/servicecomb/pack/alpha/core/fsm/event/internal/CompensateAckTimeoutEvent.java b/alpha/alpha-core/src/main/java/org/apache/servicecomb/pack/alpha/core/fsm/event/internal/CompensateAckTimeoutEvent.java new file mode 100644 index 000..d21503b --- /dev/null +++ b/alpha/alpha-core/src/main/java/org/apache/servicecomb/pack/alpha/core/fsm/event/internal/CompensateAckTimeoutEvent.java @@ -0,0 +1,86 @@ +/* + * 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.pack.alpha.core.fsm.event.internal; + +import java.util.Date; +import org.apache.servicecomb.pack.alpha.core.fsm.event.base.TxEvent; + +public class CompensateAckTimeoutEvent extends TxEvent { + + private byte[] payloads; + + public byte[] getPayloads() { +return payloads; + } + + public void setPayloads(byte[] payloads) { +this.payloads = payloads; + } + + public static Builder builder() { +return new Builder(); + } + + public static final class Builder { + +private CompensateAckTimeoutEvent txCompensatedEvent; + +private Builder() { + txCompensatedEvent = new CompensateAckTimeoutEvent(); +} + +public Builder serviceName(String serviceName) { + txCompensatedEvent.setServiceName(serviceName); + return this; +} + +public Builder instanceId(String instanceId) { + txCompensatedEvent.setInstanceId(instanceId); + return this; +} + +public Builder parentTxId(String parentTxId) { + txCompensatedEvent.setParentTxId(parentTxId); + return this; +} + +public Builder localTxId(String localTxId) { + txCompensatedEvent.setLocalTxId(localTxId); + return this; +} + +public Builder globalTxId(String globalTxId) { + txCompensatedEvent.setGlobalTxId(globalTxId); + return this; +} + +public Builder createTime(Date createTime){ + txCompensatedEvent.setCreateTime(createTime); + return this; +} + +public Builder payloads(byte[] payloads){ + txCompensatedEvent.setPayloads(payloads); + return this; +} + +public CompensateAckTimeoutEvent build() { + return txCompensatedEvent; +} + } +} \ No newline at end of file diff --git a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/SagaActor.java b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/SagaActor.java index a7c74e2..5e8aee8 100644 --- a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/SagaActor.java +++ b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/SagaActor.java @@ -21,17 +21,21 @@ import akka.actor.PoisonPill; import akka.actor.Props; import akka.cluster.sharding.ShardRegion; import akka.persistence.fsm.AbstractPersistentFSM; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.invoke.MethodHandles; import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.apache.servicecomb.pack.alpha.core.AlphaException; import org.apache.servicecomb.pack.alpha.core.fsm.SuspendedType; import org.apache.servicecomb.pack.alpha.core.fsm.TxState; import org.apache.servicecomb.pack.alpha.core.fsm.event.TxCompensateAckFailedEvent; import org.apache.servicecomb.pack.alpha.core.fsm.event.TxCompensateAckSucceedEvent; import org.apache.servicecomb.pack.alpha.core.fsm.event.base.BaseEvent; +import
[servicecomb-pack] 05/06: SCB-1735 Add compensation timeout case for Integration Test
This is an automated email from the ASF dual-hosted git repository. ningjiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-pack.git commit 1e0f417f6656c8572a6ba660e416d01c3817f06c Author: Lei Zhang AuthorDate: Sun Mar 22 13:27:58 2020 +0800 SCB-1735 Add compensation timeout case for Integration Test --- .../alpha/server/fsm/AlphaIntegrationFsmTest.java | 27 ++ .../alpha/server/fsm/OmegaEventSagaSimulator.java | 27 ++ .../apache/servicecomb/pack/common/EventType.java | 3 ++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/AlphaIntegrationFsmTest.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/AlphaIntegrationFsmTest.java index 7dd2600..15c1a0e 100644 --- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/AlphaIntegrationFsmTest.java +++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/AlphaIntegrationFsmTest.java @@ -184,6 +184,33 @@ public class AlphaIntegrationFsmTest { } @Test + public void middleTxAbortedEventAndCompensationTimeoutTest() { +omegaEventSender.onConnected(); +final String globalTxId = UUID.randomUUID().toString(); +final String localTxId_1 = UUID.randomUUID().toString(); +final String localTxId_2 = UUID.randomUUID().toString(); +omegaEventSender.getOmegaEventSagaSimulator() +.middleTxAbortedEventAndCompensationTimeoutEvents(globalTxId, localTxId_1, localTxId_2).stream().forEach(event -> { + omegaEventSender.getBlockingStub().onTxEvent(event); +}); +await().atMost(6, SECONDS).until(() -> { + SagaData sagaData = SagaDataExtension.SAGA_DATA_EXTENSION_PROVIDER.get(system) + .getLastSagaData(); + return sagaData != null && sagaData.isTerminated() + && sagaData.getLastState() == SagaActorState.SUSPENDED; +}); +SagaData sagaData = SagaDataExtension.SAGA_DATA_EXTENSION_PROVIDER.get(system) +.getLastSagaData(); +assertEquals(sagaData.getLastState(), SagaActorState.SUSPENDED); +assertEquals(sagaData.getTxEntities().size(), 2); +assertNotNull(sagaData.getBeginTime()); +assertNotNull(sagaData.getEndTime()); +assertTrue(sagaData.getEndTime().getTime() > sagaData.getBeginTime().getTime()); +assertEquals(sagaData.getTxEntities().get(localTxId_1).getState(), TxState.COMPENSATED_FAILED); +assertEquals(sagaData.getTxEntities().get(localTxId_2).getState(), TxState.FAILED); + } + + @Test public void lastTxAbortedEventTest() { omegaEventSender.onConnected(); final String globalTxId = UUID.randomUUID().toString(); diff --git a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/OmegaEventSagaSimulator.java b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/OmegaEventSagaSimulator.java index 34348b5..13eb3f1 100644 --- a/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/OmegaEventSagaSimulator.java +++ b/alpha/alpha-server/src/test/java/org/apache/servicecomb/pack/alpha/server/fsm/OmegaEventSagaSimulator.java @@ -61,6 +61,19 @@ public class OmegaEventSagaSimulator { return sagaEvents; } + public List middleTxAbortedEventAndCompensationTimeoutEvents(String globalTxId, String localTxId_1, String localTxId_2){ +final int localTxId_1_ReverseTimeoutSecond = 2; +List sagaEvents = new ArrayList<>(); +sagaEvents.add(sagaStartedEvent(globalTxId)); +sagaEvents.add(txStartedEvent(globalTxId, localTxId_1, globalTxId, "service a".getBytes(), "method a", 0, localTxId_1_ReverseTimeoutSecond)); +sagaEvents.add(txEndedEvent(globalTxId, localTxId_1, globalTxId, "service a".getBytes(), "method a")); +sagaEvents.add(txStartedEvent(globalTxId, localTxId_2, globalTxId, "service b".getBytes(), "method b")); +sagaEvents.add(txAbortedEvent(globalTxId, localTxId_2, globalTxId, NullPointerException.class.getName().getBytes(), "method b")); +sagaEvents.add(txCompensateAckTimeoutEvent(globalTxId, localTxId_2, globalTxId)); +sagaEvents.add(sagaAbortedEvent(globalTxId)); +return sagaEvents; + } + public List lastTxAbortedEvents(String globalTxId, String localTxId_1, String localTxId_2, String localTxId_3){ List sagaEvents = new ArrayList<>(); sagaEvents.add(sagaStartedEvent(globalTxId)); @@ -219,6 +232,13 @@ public class OmegaEventSagaSimulator { 0, 0, 0, 0); } + private GrpcTxEvent txStartedEvent(String globalTxId, + String localTxId, String parentTxId, byte[] payloads, String compensationMethod, int reverseRetries, int reverseTimeout) { +return eventOf(EventType.TxStartedEvent, globalTxId, localTxId, +parentTxId, payloads, compensationMethod, 0, "", +0, 0, reverseRetries, reverseTimeout); + } + private
[servicecomb-pack] 04/06: SCB-1735 Adding a new event to the state machine
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/servicecomb-pack.git commit 0573fd82d221fd562de3db5b06ebd1843653 Author: Lei Zhang AuthorDate: Sat Mar 21 23:23:11 2020 +0800 SCB-1735 Adding a new event to the state machine --- docs/fsm/plantuml/saga-state-diagram.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fsm/plantuml/saga-state-diagram.puml b/docs/fsm/plantuml/saga-state-diagram.puml index 35cf83e..77e1d20 100644 --- a/docs/fsm/plantuml/saga-state-diagram.puml +++ b/docs/fsm/plantuml/saga-state-diagram.puml @@ -33,7 +33,7 @@ FAILED --> COMPENSATED : SagaAbortedEvent:doCompensation FAILED --> SUSPENDED : SagaTimeoutEvent -FAILED --> FAILED : TxCompensateAckSucceedEvent:UpdateTxEntity\nTxCompensateAckFailedEvent:UpdateTxEntity\nTxStartedEvent:AddTxEntity\nTxEndedEvent:doCompensation\nComponsitedCheckEvent +FAILED --> FAILED : TxCompensateAckSucceedEvent:UpdateTxEntity\nTxCompensateAckFailedEvent:UpdateTxEntity\nTxCompensateAckTimeoutEvent:UpdateTxEntity\nTxStartedEvent:AddTxEntity\nTxEndedEvent:doCompensation\nComponsitedCheckEvent COMPENSATED --> [*]
[servicecomb-pack] 06/06: SCB-1735 Removing unused code
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/servicecomb-pack.git commit 97b95589184381b56c7ba37e301ce1c077547f0d Author: Lei Zhang AuthorDate: Sun Mar 22 15:58:44 2020 +0800 SCB-1735 Removing unused code --- .../pack/alpha/fsm/domain/UpdateTxEventDomain.java | 26 -- 1 file changed, 26 deletions(-) diff --git a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/domain/UpdateTxEventDomain.java b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/domain/UpdateTxEventDomain.java index 24877f7..97d3b02 100644 --- a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/domain/UpdateTxEventDomain.java +++ b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/domain/UpdateTxEventDomain.java @@ -26,7 +26,6 @@ import org.apache.servicecomb.pack.alpha.core.fsm.event.TxEndedEvent; import org.apache.servicecomb.pack.alpha.core.fsm.event.base.BaseEvent; public class UpdateTxEventDomain implements DomainEvent { - private String parentTxId; private String localTxId; private TxState state; private byte[] throwablePayLoads; @@ -34,14 +33,12 @@ public class UpdateTxEventDomain implements DomainEvent { public UpdateTxEventDomain(TxEndedEvent event) { this.event = event; -this.parentTxId = event.getParentTxId(); this.localTxId = event.getLocalTxId(); this.state = TxState.COMMITTED; } public UpdateTxEventDomain(TxAbortedEvent event) { this.event = event; -this.parentTxId = event.getParentTxId(); this.localTxId = event.getLocalTxId(); this.throwablePayLoads = event.getPayloads(); this.state = TxState.FAILED; @@ -49,58 +46,35 @@ public class UpdateTxEventDomain implements DomainEvent { public UpdateTxEventDomain(TxCompensateAckSucceedEvent event) { this.event = event; -this.parentTxId = event.getParentTxId(); this.localTxId = event.getLocalTxId(); this.state = TxState.COMPENSATED_SUCCEED; } public UpdateTxEventDomain(TxCompensateAckFailedEvent event) { this.event = event; -this.parentTxId = event.getParentTxId(); this.localTxId = event.getLocalTxId(); this.state = TxState.COMPENSATED_FAILED; } public UpdateTxEventDomain(CompensateAckTimeoutEvent event) { this.event = event; -this.parentTxId = event.getParentTxId(); this.localTxId = event.getLocalTxId(); this.throwablePayLoads = event.getPayloads(); this.state = TxState.COMPENSATED_FAILED; } - public String getParentTxId() { -return parentTxId; - } - - public void setParentTxId(String parentTxId) { -this.parentTxId = parentTxId; - } - public String getLocalTxId() { return localTxId; } - public void setLocalTxId(String localTxId) { -this.localTxId = localTxId; - } - public TxState getState() { return state; } - public void setState(TxState state) { -this.state = state; - } - public byte[] getThrowablePayLoads() { return throwablePayLoads; } - public void setThrowablePayLoads(byte[] throwablePayLoads) { -this.throwablePayLoads = throwablePayLoads; - } - @Override public BaseEvent getEvent() { return event;
[servicecomb-pack] branch master updated (d2b8434 -> 97b9558)
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/servicecomb-pack.git. from d2b8434 SCB-1724 Update upgrade-guide & state-diagram documents for SCB-1696 new 655b6dd SCB-1735 Modify compensate method support asynchronous timeout new 2d98d6b SCB-1735 Catch the compensation method timeout exception and send a CompensateAckTimeoutEvent event and record new 58021df SCB-1735 Show TxCompensateAckTimeoutEvent in the transaction details list new 0573fd8 SCB-1735 Adding a new event to the state machine new 1e0f417 SCB-1735 Add compensation timeout case for Integration Test new 97b9558 SCB-1735 Removing unused code The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../CompensateAckTimeoutEvent.java}| 10 ++--- .../servicecomb/pack/alpha/fsm/SagaActor.java | 44 ++ .../pack/alpha/fsm/domain/UpdateTxEventDomain.java | 29 +++--- .../integration/akka/SpringAkkaExtension.java | 16 +++- .../alpha/server/fsm/AlphaIntegrationFsmTest.java | 27 + .../alpha/server/fsm/OmegaEventSagaSimulator.java | 27 + .../alpha/ui/controller/TransactionController.java | 7 ++-- .../resources/templates/transaction_details.html | 8 ++-- docs/fsm/plantuml/saga-state-diagram.puml | 2 +- .../apache/servicecomb/pack/common/EventType.java | 3 +- 10 files changed, 128 insertions(+), 45 deletions(-) copy alpha/alpha-core/src/main/java/org/apache/servicecomb/pack/alpha/core/fsm/event/{TxCompensateAckFailedEvent.java => internal/CompensateAckTimeoutEvent.java} (88%)
[servicecomb-pack] 03/06: SCB-1735 Show TxCompensateAckTimeoutEvent in the transaction details list
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/servicecomb-pack.git commit 58021df82e9943bbd049a5c7c16c838337d7fd6b Author: Lei Zhang AuthorDate: Sat Mar 21 22:14:23 2020 +0800 SCB-1735 Show TxCompensateAckTimeoutEvent in the transaction details list --- .../pack/alpha/ui/controller/TransactionController.java | 7 --- .../src/main/resources/templates/transaction_details.html | 8 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java b/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java index a8491ce..c1c8066 100644 --- a/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java +++ b/alpha/alpha-ui/src/main/java/org/apache/servicecomb/pack/alpha/ui/controller/TransactionController.java @@ -181,9 +181,10 @@ public class TransactionController { eventDTO.setRetryDelayInMilliseconds(Long.valueOf(event.get("retryDelayInMilliseconds").toString())); } } - if (eventDTO.getType().equals("TxAbortedEvent") || eventDTO.getType() - .equals("SagaAbortedEvent") || eventDTO.getType() - .equals("TxCompensateAckFailedEvent")) { + if (eventDTO.getType().equals("TxAbortedEvent") || + eventDTO.getType().equals("SagaAbortedEvent") || + eventDTO.getType().equals("TxCompensateAckFailedEvent") || + eventDTO.getType().equals("TxCompensateAckTimeoutEvent")) { if (event.containsKey("payloads")) { Decoder decoder = Base64.getDecoder(); String exception; diff --git a/alpha/alpha-ui/src/main/resources/templates/transaction_details.html b/alpha/alpha-ui/src/main/resources/templates/transaction_details.html index 8df399f..b21fa7d 100644 --- a/alpha/alpha-ui/src/main/resources/templates/transaction_details.html +++ b/alpha/alpha-ui/src/main/resources/templates/transaction_details.html @@ -32,9 +32,9 @@ - + - + @@ -44,7 +44,7 @@ - + @@ -61,7 +61,7 @@ - + Exception Stack
[GitHub] [servicecomb-pack] WillemJiang merged pull request #638: [SCB-1735] Support Alpha call compensation timeout strategy
WillemJiang merged pull request #638: [SCB-1735] Support Alpha call compensation timeout strategy URL: https://github.com/apache/servicecomb-pack/pull/638 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-pack] 01/06: SCB-1735 Modify compensate method support asynchronous timeout
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/servicecomb-pack.git commit 655b6dd497fd8e71b4a8b790a733c25435d8ca7f Author: Lei Zhang AuthorDate: Sat Mar 21 22:08:19 2020 +0800 SCB-1735 Modify compensate method support asynchronous timeout --- .../fsm/spring/integration/akka/SpringAkkaExtension.java | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/spring/integration/akka/SpringAkkaExtension.java b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/spring/integration/akka/SpringAkkaExtension.java index 6346d80..6892a20 100644 --- a/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/spring/integration/akka/SpringAkkaExtension.java +++ b/alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/spring/integration/akka/SpringAkkaExtension.java @@ -23,6 +23,10 @@ import akka.actor.AbstractExtensionId; import akka.actor.ExtendedActorSystem; import akka.actor.Extension; import java.lang.invoke.MethodHandles; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.apache.servicecomb.pack.alpha.core.OmegaCallback; import org.apache.servicecomb.pack.alpha.core.TxEvent; import org.apache.servicecomb.pack.alpha.fsm.model.TxEntity; @@ -47,7 +51,17 @@ public class SpringAkkaExtension extends AbstractExtensionId { private volatile ApplicationContext applicationContext; private OmegaCallback omegaCallback; -public void compensate(TxEntity txEntity) { +public void compensate(TxEntity txEntity) +throws InterruptedException, ExecutionException, TimeoutException { + if (txEntity.getReverseTimeout() > 0) { +CompletableFuture.runAsync(() -> doCompensate(txEntity)) +.get(txEntity.getReverseTimeout(), TimeUnit.SECONDS); + } else { +doCompensate(txEntity); + } +} + +private void doCompensate(TxEntity txEntity) { if (applicationContext != null) { if (applicationContext.containsBean(omegaCallbackBeanName)) { omegaCallback = applicationContext.getBean(omegaCallbackBeanName, OmegaCallback.class);
[GitHub] [servicecomb-java-chassis] coveralls edited a comment on issue #1665: [SCB-1796] support client outlog: rename item and delete README.md
coveralls edited a comment on issue #1665: [SCB-1796] support client outlog: rename item and delete README.md URL: https://github.com/apache/servicecomb-java-chassis/pull/1665#issuecomment-603758842 [![Coverage Status](https://coveralls.io/builds/29602827/badge)](https://coveralls.io/builds/29602827) Coverage remained the same at 84.984% when pulling **099aca4cc9d7ee4c38928a2bd49e11505823aa22 on heyile:scb-1796** into **6cef5feb94807a246611dc213ba23512def06dc6 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] coveralls commented on issue #1665: [SCB-1796] support client outlog: rename item and delete README.md
coveralls commented on issue #1665: [SCB-1796] support client outlog: rename item and delete README.md URL: https://github.com/apache/servicecomb-java-chassis/pull/1665#issuecomment-603758842 [![Coverage Status](https://coveralls.io/builds/29602824/badge)](https://coveralls.io/builds/29602824) Coverage decreased (-0.01%) to 84.973% when pulling **099aca4cc9d7ee4c38928a2bd49e11505823aa22 on heyile:scb-1796** into **6cef5feb94807a246611dc213ba23512def06dc6 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang opened a new pull request #127: able to get key by id
tianxiaoliang opened a new pull request #127: able to get key by id URL: https://github.com/apache/servicecomb-kie/pull/127 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] heyile commented on a change in pull request #1660: [SCB-1815] Support sdk use different address to registry and discover…
heyile commented on a change in pull request #1660: [SCB-1815] Support sdk use different address to registry and discover… URL: https://github.com/apache/servicecomb-java-chassis/pull/1660#discussion_r397722997 ## File path: common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/element/impl/DatetimeAccessConfigurableItem.java ## @@ -49,15 +49,15 @@ /** * all configuration is set to default value. */ - public DatetimeConfigurableItemAccess() { + public DatetimeAccessConfigurableItem() { this(DEFAULT_DATETIME_PATTERN); } /** * the configurations not specified will get a default value. * @param config the format of configuration is "PATTERN|TIMEZONE|LOCALE" or "PATTERN". It depends on whether the config contains the separator "|" */ - public DatetimeConfigurableItemAccess(String config) { + public DatetimeAccessConfigurableItem(String config) { Review comment: ok, i will modify it in #1665 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] heyile opened a new pull request #1665: [SCB-1796] support client outlog: rename item and delete README.md
heyile opened a new pull request #1665: [SCB-1796] support client outlog: rename item and delete README.md URL: https://github.com/apache/servicecomb-java-chassis/pull/1665 Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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] [servicecomb-kie] zhulijian1 opened a new pull request #126: kv返回体时间使用时间戳
zhulijian1 opened a new pull request #126: kv返回体时间使用时间戳 URL: https://github.com/apache/servicecomb-kie/pull/126 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1661: 怎么获取同一APPID Provider的所有实例信息
liubao68 commented on issue #1661: 怎么获取同一APPID Provider的所有实例信息 URL: https://github.com/apache/servicecomb-java-chassis/issues/1661#issuecomment-603738466 这里提供了一个例子,如何实现你的场景: https://github.com/apache/servicecomb-java-chassis/pull/1664 1. 通过 DiscoveryTree 获取某个微服务的所有实例; 2. 调用 Provider 接口的时候, 指定具体的实例信息。 不过这个 PR 没合入,有两个问题需要注意: 1. 如果采用 RestTemplate 调用, 设置 local context 有问题 2. 如果采用 RPC 调用, 需要注意这个接口只能够声明一个 consumer, 携带 InvocationContext 参数 如果你是在某个 REST 接口里面调用其他服务的接口, 则可以直接使用: ``` ContextUtils.getInvocationContext().addLocalContext 设置地址信息,则不会存在上述两个问题。 ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 opened a new pull request #1664: [SCB-1822]fix problems when using multiple consumer interface for one…
liubao68 opened a new pull request #1664: [SCB-1822]fix problems when using multiple consumer interface for one… URL: https://github.com/apache/servicecomb-java-chassis/pull/1664 … operation and using CseHttpEntity to set localcontext Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [ ] Each commit in the pull request should have a meaningful subject line and body. - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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] [servicecomb-kie] tianxiaoliang commented on a change in pull request #125: fix status don't update
tianxiaoliang commented on a change in pull request #125: fix status don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397713434 ## File path: server/resource/v1/history_resource_test.go ## @@ -90,8 +90,8 @@ func TestHistoryResource_GetPollingData(t *testing.T) { t.Run("list kv by service label, to create a polling data", func(t *testing.T) { r, _ := http.NewRequest("GET", "/v1/test/kie/kv", nil) noopH := {} - noopH2 := {} Review comment: noop 的意思是no operation This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #125: fix status don't update
tianxiaoliang commented on a change in pull request #125: fix status don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397713980 ## File path: server/resource/v1/history_resource_test.go ## @@ -90,8 +90,8 @@ func TestHistoryResource_GetPollingData(t *testing.T) { t.Run("list kv by service label, to create a polling data", func(t *testing.T) { r, _ := http.NewRequest("GET", "/v1/test/kie/kv", nil) noopH := {} - noopH2 := {} Review comment: 还是改下吧,1,2这种命名也是很奇怪的 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-java-chassis] branch master updated: change kie label env to environment
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/servicecomb-java-chassis.git The following commit(s) were added to refs/heads/master by this push: new 6cef5fe change kie label env to environment 6cef5fe is described below commit 6cef5feb94807a246611dc213ba23512def06dc6 Author: GuoYL AuthorDate: Mon Mar 23 20:55:22 2020 +0800 change kie label env to environment --- .../servicecomb/config/kie/client/KieUtil.java | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieUtil.java b/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieUtil.java index 1e91d37..fd6fd1a 100644 --- a/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieUtil.java +++ b/dynamic-config/config-kie/src/main/java/org/apache/servicecomb/config/kie/client/KieUtil.java @@ -39,8 +39,17 @@ import org.springframework.core.io.ByteArrayResource; import org.springframework.util.StringUtils; public class KieUtil { + private static final Logger LOGGER = LoggerFactory.getLogger(KieUtil.class); + private static final String LABEL_ENV = "environment"; + + private static final String LABEL_APP = "app"; + + private static final String LABEL_SERVICE = "service"; + + private static final String LABEL_VERSION = "version"; + public static String encrypt(String dataStr) { MessageDigest messageDigest = null; String result = ""; @@ -62,20 +71,19 @@ public class KieUtil { List versionList = new ArrayList<>(); for (KVDoc kvDoc : resp.getData()) { Map labelsMap = kvDoc.getLabels(); - //todo:how to deal env - if (labelsMap.containsKey("app") && labelsMap.get("app") + if (labelsMap.containsKey(LABEL_APP) && labelsMap.get(LABEL_APP) .equals(KieConfig.INSTANCE.getAppName()) - && labelsMap.containsKey("env") && labelsMap.get("env") + && labelsMap.containsKey(LABEL_ENV) && labelsMap.get(LABEL_ENV) .equals(KieConfig.INSTANCE.getEnvironment())) { -if (!labelsMap.containsKey("service")) { +if (!labelsMap.containsKey(LABEL_SERVICE)) { appList.add(kvDoc); } -if (labelsMap.containsKey("service") && labelsMap.get("service") +if (labelsMap.containsKey(LABEL_SERVICE) && labelsMap.get(LABEL_SERVICE) .equals(KieConfig.INSTANCE.getServiceName())) { - if (!kvDoc.getLabels().containsKey("version")) { + if (!kvDoc.getLabels().containsKey(LABEL_VERSION)) { serviceList.add(kvDoc); } - if (labelsMap.containsKey("version") && labelsMap.get("version") + if (labelsMap.containsKey(LABEL_VERSION) && labelsMap.get(LABEL_VERSION) .equals(KieConfig.INSTANCE.getServiceName())) { versionList.add(kvDoc); }
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1657: [SCB-1823] change kie label env to environment
liubao68 merged pull request #1657: [SCB-1823] change kie label env to environment URL: https://github.com/apache/servicecomb-java-chassis/pull/1657 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] Caixinyang opened a new issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter
Caixinyang opened a new issue #1663: mockmvc测试接口异常现象,用例不进入ExceptionToProducerResponseConverter URL: https://github.com/apache/servicecomb-java-chassis/issues/1663 背景:程序使用ExceptionToProducerResponseConverter捕捉ConstraintViolationException参数异常并返回。 ![image](https://user-images.githubusercontent.com/30398258/77521015-fd40a280-6ebc-11ea-8391-6f72daed3f85.png) 现象:构造测试用例传递非法入参,用例直接返回4xx错误,不进入ExceptionToProducerResponseConverter。 ![image](https://user-images.githubusercontent.com/30398258/77521059-0e89af00-6ebd-11ea-84b0-0d6522b27e70.png) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #1660: [SCB-1815] Support sdk use different address to registry and discover…
liubao68 commented on a change in pull request #1660: [SCB-1815] Support sdk use different address to registry and discover… URL: https://github.com/apache/servicecomb-java-chassis/pull/1660#discussion_r397707391 ## File path: common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/element/impl/DatetimeAccessConfigurableItem.java ## @@ -49,15 +49,15 @@ /** * all configuration is set to default value. */ - public DatetimeConfigurableItemAccess() { + public DatetimeAccessConfigurableItem() { this(DEFAULT_DATETIME_PATTERN); } /** * the configurations not specified will get a default value. * @param config the format of configuration is "PATTERN|TIMEZONE|LOCALE" or "PATTERN". It depends on whether the config contains the separator "|" */ - public DatetimeConfigurableItemAccess(String config) { + public DatetimeAccessConfigurableItem(String config) { Review comment: ConfigurableDatetimeAccessItem This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #1658: [SCB-1816] print the instance endpoints in the end of the start up log
liubao68 merged pull request #1658: [SCB-1816] print the instance endpoints in the end of the start up log URL: https://github.com/apache/servicecomb-java-chassis/pull/1658 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[servicecomb-java-chassis] branch master updated: [SCB-1816] print the instance endpoints in the end of the start up log
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/servicecomb-java-chassis.git The following commit(s) were added to refs/heads/master by this push: new d4ed334 [SCB-1816] print the instance endpoints in the end of the start up log d4ed334 is described below commit d4ed33475df5d6c26182d4f5d95abeeb9628321a Author: yhs0092 AuthorDate: Mon Mar 23 22:18:22 2020 +0800 [SCB-1816] print the instance endpoints in the end of the start up log --- .../servicecomb/core/bootup/ServiceInformationCollector.java | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/apache/servicecomb/core/bootup/ServiceInformationCollector.java b/core/src/main/java/org/apache/servicecomb/core/bootup/ServiceInformationCollector.java index d299b92..78e05b7 100644 --- a/core/src/main/java/org/apache/servicecomb/core/bootup/ServiceInformationCollector.java +++ b/core/src/main/java/org/apache/servicecomb/core/bootup/ServiceInformationCollector.java @@ -19,8 +19,9 @@ package org.apache.servicecomb.core.bootup; import org.apache.servicecomb.serviceregistry.RegistryUtils; -public class ServiceInformationCollector implements BootUpInformationCollector { +import io.vertx.core.spi.json.JsonCodec; +public class ServiceInformationCollector implements BootUpInformationCollector { @Override public String collect() { @@ -29,7 +30,12 @@ public class ServiceInformationCollector implements BootUpInformationCollector { + "\n" + "Version: " + RegistryUtils.getMicroservice().getVersion() + "\n" + "Environment: " + RegistryUtils.getMicroservice().getEnvironment() + "\n" + "Service ID: " + RegistryUtils.getMicroserviceInstance().getServiceId() -+ "\n" + "Instance ID: " + RegistryUtils.getMicroserviceInstance().getInstanceId(); ++ "\n" + "Instance ID: " + RegistryUtils.getMicroserviceInstance().getInstanceId() ++ "\n" + "Endpoints: " + getEndpoints(); + } + + private String getEndpoints() { +return JsonCodec.INSTANCE.toString(RegistryUtils.getMicroserviceInstance().getEndpoints()); } @Override
[GitHub] [servicecomb-java-chassis] w00189670 opened a new issue #1662: servicecomb启动报空指针异常
w00189670 opened a new issue #1662: servicecomb启动报空指针异常 URL: https://github.com/apache/servicecomb-java-chassis/issues/1662 2020-03-25T11:49:29.948+0800 || http-nio-8080-exec-3 || [.[.[.[ServicecombRestServlet].175 || ERROR || Servlet.service() for servlet [ServicecombRestServlet] in context with path [] threw exception java.lang.NullPointerException: null at org.apache.servicecomb.common.rest.locator.ServicePathManager.getServicePathManager(ServicePathManager.java:59) at org.apache.servicecomb.common.rest.AbstractRestInvocation.findRestOperation(AbstractRestInvocation.java:80) at org.apache.servicecomb.common.rest.RestProducerInvocation.findRestOperation(RestProducerInvocation.java:57) at org.apache.servicecomb.transport.rest.servlet.RestServletProducerInvocation.findRestOperation(RestServletProducerInvocation.java:28) at org.apache.servicecomb.common.rest.RestProducerInvocation.invoke(RestProducerInvocation.java:46) at org.apache.servicecomb.transport.rest.servlet.ServletRestDispatcher.service(ServletRestDispatcher.java:57) at org.apache.servicecomb.transport.rest.servlet.RestServlet.service(RestServlet.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.huawei.appgallery.quickapp.portal.component.xss.XssFilter.doFilter(XssFilter.java:33) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 2020-03-25T11:49:29.953+0800 || http-nio-8080-exec-3 || [.[.[.[ServicecombRestServlet].175 || ERROR || Servlet.service() for servlet [ServicecombRestServlet] threw exception java.lang.IllegalStateException: Calling [asyncStart()] is not valid for a request with Async state [STARTING] at org.apache.coyote.AsyncStateMachine.asyncStart(AsyncStateMachine.java:242) at org.apache.coyote.AbstractProcessor.action(AbstractProcessor.java:497) at org.apache.coyote.Request.action(Request.java:432) at org.apache.catalina.core.AsyncContextImpl.setStarted(AsyncContextImpl.java:323) at org.apache.catalina.connector.Request.startAsync(Request.java:1700) at org.apache.catalina.connector.Request.startAsync(Request.java:1682) at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1043) at javax.servlet.ServletRequestWrapper.startAsync(ServletRequestWrapper.java:383) at
[GitHub] [servicecomb-kie] GuoYL123 commented on a change in pull request #125: fix status don't update
GuoYL123 commented on a change in pull request #125: fix status don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397681357 ## File path: server/service/mongo/kv/kv_dao.go ## @@ -82,6 +82,8 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc) error { ur, err := collection.UpdateOne(ctx, bson.M{"key": kv.Key, "label_id": kv.LabelID}, bson.D{ {"$set", bson.D{ {"value", kv.Value}, + {"value_type", kv.ValueType}, Review comment: 取消了value_type的更新 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #125: fix status/value_type don't update
tianxiaoliang commented on a change in pull request #125: fix status/value_type don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397674245 ## File path: server/service/mongo/kv/kv_dao.go ## @@ -82,6 +82,8 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc) error { ur, err := collection.UpdateOne(ctx, bson.M{"key": kv.Key, "label_id": kv.LabelID}, bson.D{ {"$set", bson.D{ {"value", kv.Value}, + {"value_type", kv.ValueType}, Review comment: 我担心引入复杂性,类型这种东西以后我们要基于它做什么演进特性就麻烦了,我只想减少复杂度引起的思考 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397672093 ## File path: pkg/validate/validator_test.go ## @@ -0,0 +1,36 @@ +package validate_test + +import ( + "testing" + + "github.com/apache/servicecomb-kie/pkg/validate" + "github.com/stretchr/testify/assert" +) + +type student struct { + Namestring `validate:"kieTest"` Review comment: 用真实的业务模型测 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397670653 ## File path: pkg/model/db_schema.go ## @@ -31,19 +31,19 @@ type LabelDoc struct { type KVDoc struct { ID string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"` LabelIDstring `json:"label_id,omitempty" bson:"label_id,omitempty" yaml:"label_id,omitempty"` - Keystring `json:"key" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties - Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script + Keystring `json:"key" yaml:"key" validate:"kieKey"` Review comment: kieKey改成key多好 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397670870 ## File path: pkg/model/db_schema.go ## @@ -31,19 +31,19 @@ type LabelDoc struct { type KVDoc struct { ID string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"` LabelIDstring `json:"label_id,omitempty" bson:"label_id,omitempty" yaml:"label_id,omitempty"` - Keystring `json:"key" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties - Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script + Keystring `json:"key" yaml:"key" validate:"kieKey"` + Value string `json:"value,omitempty" yaml:"value,omitempty" validate:"ascii,min=1,max=2097152"` + ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty" validate:"kieValueType"` //ini,json,text,yaml,properties Review comment: kieValueType改成 valueType This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397671036 ## File path: pkg/model/db_schema.go ## @@ -31,19 +31,19 @@ type LabelDoc struct { type KVDoc struct { ID string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"` LabelIDstring `json:"label_id,omitempty" bson:"label_id,omitempty" yaml:"label_id,omitempty"` - Keystring `json:"key" yaml:"key"` - Value string `json:"value,omitempty" yaml:"value,omitempty"` - ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties - Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script + Keystring `json:"key" yaml:"key" validate:"kieKey"` + Value string `json:"value,omitempty" yaml:"value,omitempty" validate:"ascii,min=1,max=2097152"` + ValueType string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty" validate:"kieValueType"` //ini,json,text,yaml,properties + Checkerstring `json:"check,omitempty" yaml:"check,omitempty"` //python script CreateRevision int64 `json:"create_revision,omitempty" bson:"create_revision," yaml:"create_revision,omitempty"` UpdateRevision int64 `json:"update_revision,omitempty" bson:"update_revision," yaml:"update_revision,omitempty"` Projectstring `json:"project,omitempty" yaml:"project,omitempty"` - Status string `json:"status,omitempty" yaml:"status,omitempty"` + Status string `json:"status,omitempty" yaml:"status,omitempty" validate:"kieKvStatus"` Review comment: 改成kvStatus This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397672904 ## File path: pkg/validate/instance.go ## @@ -0,0 +1,37 @@ +package validate + +import "github.com/go-mesh/openlogging" + +var defaultValidator *Validator + +// custom validate rules +// tag names suggested to be "kie*", to distinguish from third party tags +var customRules = []*RegexValidateRule{ + NewRule("kieKey", `^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, {Min: 1, Max: 256}), + NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, nil), + NewRule("kieKvStatus", `^(enabled|disabled){0,1}$`, nil), +} + +// tags of third party validate rules we used, for error translation +var thirdPartyTags = []string{ + "min", "max", "length", +} + +func init() { + defaultValidator = NewValidator() + for _, r := range customRules { + if err := defaultValidator.RegisterRule(r); err != nil { + openlogging.Fatal("Init validate failed: " + err.Error()) Review comment: init中不建议panic,显示的调用Init方法吧,初始化失败就推出,运行时突然因为第一次初始化validate而导致panic,这不合理 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397653872 ## File path: go.mod ## @@ -6,8 +6,11 @@ require ( github.com/go-chassis/go-chassis v0.0.0-20200322084331-36849ab2cb10 github.com/go-chassis/paas-lager v1.1.1 github.com/go-mesh/openlogging v1.0.1 + github.com/go-playground/universal-translator v0.17.0 + github.com/go-playground/validator v9.29.0+incompatible Review comment: 已经v10了,用v10如何 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397669847 ## File path: pkg/validate/instance.go ## @@ -0,0 +1,37 @@ +package validate + +import "github.com/go-mesh/openlogging" + +var defaultValidator *Validator + +// custom validate rules +// tag names suggested to be "kie*", to distinguish from third party tags +var customRules = []*RegexValidateRule{ + NewRule("kieKey", `^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, {Min: 1, Max: 256}), + NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, nil), + NewRule("kieKvStatus", `^(enabled|disabled){0,1}$`, nil), Review comment: status为空也是合法的,默认值启用 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #124: Support parameter validation
tianxiaoliang commented on a change in pull request #124: Support parameter validation URL: https://github.com/apache/servicecomb-kie/pull/124#discussion_r397669524 ## File path: pkg/validate/instance.go ## @@ -0,0 +1,37 @@ +package validate + +import "github.com/go-mesh/openlogging" + +var defaultValidator *Validator + +// custom validate rules +// tag names suggested to be "kie*", to distinguish from third party tags +var customRules = []*RegexValidateRule{ + NewRule("kieKey", `^[a-zA-Z0-9]*$|^[a-zA-Z0-9][a-zA-Z0-9_\-.]*[a-zA-Z0-9]$`, {Min: 1, Max: 256}), + NewRule("kieValueType", `^(string|ini|json|text|yaml|properties)$`, nil), Review comment: 要保证,如果value type为空也是合法的,默认类型为text 删掉string,没这个类型 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-fence] qqdbwl opened a new issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport
qqdbwl opened a new issue #24: CustomVertxRestDispatcher 在java-chassis-2.0.0中如何获取transport URL: https://github.com/apache/servicecomb-fence/issues/24 CustomVertxRestDispatcher 中引用了 org.apache.servicecomb.core.CseContext,但是在java-chassis-2.0.0中找不到 CseContext了。对应transport = CseContext.getInstance().getTransportManager().findTransport(Const.RESTFUL)如何处理呢 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] GuoYL123 commented on a change in pull request #125: fix status/value_type don't update
GuoYL123 commented on a change in pull request #125: fix status/value_type don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397654299 ## File path: server/service/mongo/kv/kv_dao.go ## @@ -82,6 +82,8 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc) error { ur, err := collection.UpdateOne(ctx, bson.M{"key": kv.Key, "label_id": kv.LabelID}, bson.D{ {"$set", bson.D{ {"value", kv.Value}, + {"value_type", kv.ValueType}, Review comment: 感觉可以前台控制,后台保留能力 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull request #125: fix status/value_type don't update
tianxiaoliang commented on a change in pull request #125: fix status/value_type don't update URL: https://github.com/apache/servicecomb-kie/pull/125#discussion_r397651742 ## File path: server/service/mongo/kv/kv_dao.go ## @@ -82,6 +82,8 @@ func updateKeyValue(ctx context.Context, kv *model.KVDoc) error { ur, err := collection.UpdateOne(ctx, bson.M{"key": kv.Key, "label_id": kv.LabelID}, bson.D{ {"$set", bson.D{ {"value", kv.Value}, + {"value_type", kv.ValueType}, Review comment: value_type 本来就不支持修改 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-kie] GuoYL123 opened a new pull request #125: fix status/value_type don't update
GuoYL123 opened a new pull request #125: fix status/value_type don't update URL: https://github.com/apache/servicecomb-kie/pull/125 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [servicecomb-docs] heyile opened a new pull request #155: [SCB-1820] add doc of request log and fixes some problems: modify as …
heyile opened a new pull request #155: [SCB-1820] add doc of request log and fixes some problems: modify as … URL: https://github.com/apache/servicecomb-docs/pull/155 …review This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services