You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/03/16 14:19:08 UTC

[GitHub] [servicecomb-pack] githubcheng2978 opened a new pull request #691: 支持rabbit

githubcheng2978 opened a new pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean install` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


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

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



[GitHub] [servicecomb-pack] coolbeevip commented on pull request #691: [SCB-2238] FSM event channel supports Rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-807910278


   > @coolbeevip 什么时候可以merge 啊
   
   方便的话,你可以给我发个邮件 coolbeevip@gmail.com, 我们交换一下微信
   


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] WillemJiang merged pull request #691: [SCB-2238] FSM event channel supports Rabbit

Posted by GitBox <gi...@apache.org>.
WillemJiang merged pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691


   


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] coolbeevip commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-800301041


   I trigger CI run via reopening this issue


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on a change in pull request #691: [SCB-2238] FSM event channel supports Rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on a change in pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#discussion_r602857029



##########
File path: alpha/alpha-server/src/main/resources/application.yaml
##########
@@ -146,6 +146,46 @@ spring:
       eclipselink:
         ddl-generation: none
 
+---
+spring:
+  profiles: rabbit
+  cloud:
+    stream:
+      binders:
+        defaultRabbit:
+          type: rabbit
+          environment:
+            spring:
+              rabbitmq:
+                host: 127.0.0.1

Review comment:
       done




-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-800735054


   > I trigger CI run via reopening this issue
   
   so what should i do to resolve this problem


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 closed pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 closed pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] coolbeevip closed pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip closed pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] WillemJiang commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-805454746


   
   > @WillemJiang 麻烦看看我这个PR哪里还有问题呢
   
   我看代码你把rabbitmq的客户端代码引入到Alpha server 的环境中来了,如果用户没有使用rabbitmq的话,是不是会报系统连接不上的信息。为了避免这个副作用,建议把RabbitMQ的配置文件从main/resources 去除。 
   另外如果能附上验收测试就更好了。 


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] coolbeevip commented on a change in pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on a change in pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#discussion_r600984502



##########
File path: alpha/alpha-server/src/main/resources/application.yaml
##########
@@ -146,6 +146,46 @@ spring:
       eclipselink:
         ddl-generation: none
 
+---
+spring:
+  profiles: rabbit
+  cloud:
+    stream:
+      binders:
+        defaultRabbit:
+          type: rabbit
+          environment:
+            spring:
+              rabbitmq:
+                host: 127.0.0.1

Review comment:
       Please remove the rabbit default configuration in the application.yml file and add rabbit configuration description to the document https://github.com/apache/servicecomb-pack/blob/master/docs/fsm/eventchannel_zh.md




-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: [SCB-2238] FSM event channel supports Rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-808894756


   > > @WillemJiang 麻烦看看我这个PR哪里还有问题呢
   > 
   > 我看代码你把rabbitmq的客户端代码引入到Alpha server 的环境中来了,如果用户没有使用rabbitmq的话,是不是会报系统连接不上的信息。为了避免这个副作用,建议把RabbitMQ的配置文件从main/resources 去除。
   > 另外如果能附上验收测试就更好了。
   
   已经把RabbitMQ的配置文件从main/resources 移除掉了。
   


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-804547198


   @coolbeevip 什么时候可以merge 啊


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-801583378


   > > > I trigger CI run via reopening this issue
   > > 
   > > 
   > > so what should i do to resolve this problem
   > 
   > We just migrated CI from Travis to Github Action, your PR has been pass CI.
   > 
   > You need to modify the code according to William's suggestion and push it to [githubcheng2978:feature-rabbitmq](https://github.com/githubcheng2978/servicecomb-pack/tree/feature-rabbitmq) again
   
    ok , thanks for you help.  i  already finished it 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-765968798


   #686 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] WillemJiang commented on a change in pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on a change in pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#discussion_r567390731



##########
File path: alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/channel/rabbit/RabbitChannelAutoConfiguration.java
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.fsm.channel.rabbit;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import org.apache.servicecomb.pack.alpha.core.fsm.channel.ActorEventChannel;
+import org.apache.servicecomb.pack.alpha.fsm.metrics.MetricsService;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.cloud.stream.config.BindingProperties;
+import org.springframework.cloud.stream.config.BindingServiceProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+import java.util.Map;
+
+@EnableBinding({RabbitMessageChannel.class})
+@Configuration
+@EnableConfigurationProperties(BindingServiceProperties.class)
+@ConditionalOnProperty(value = "alpha.feature.akka.channel.type", havingValue = "rabbit")
+public class RabbitChannelAutoConfiguration {
+
+
+    @Bean
+    @ConditionalOnMissingBean()
+    public RabbitMessagePublisher rabbitMessagePublisher(BindingServiceProperties bindingServiceProperties, RabbitMessageChannel producerMessage) {
+        Map<String, BindingProperties> bindings = bindingServiceProperties.getBindings();
+        // 分区数量,现在现在生产者与消费这都在alpha-server,所以rabbit的分区partitionCount与该数量保持一直

Review comment:
       Please add English comments.

##########
File path: alpha/alpha-server/src/main/resources/application.yaml
##########
@@ -146,6 +146,46 @@ spring:
       eclipselink:
         ddl-generation: none
 
+---
+spring:
+  profiles: rabbit
+  cloud:
+    stream:
+      binders:
+        defaultRabbit:
+          type: rabbit
+          environment:
+            spring:
+              rabbitmq:
+                host: 127.0.0.1

Review comment:
       It's better to provide the default setting as docker compose does.

##########
File path: alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/channel/rabbit/RabbitChannelAutoConfiguration.java
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.fsm.channel.rabbit;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import org.apache.servicecomb.pack.alpha.core.fsm.channel.ActorEventChannel;
+import org.apache.servicecomb.pack.alpha.fsm.metrics.MetricsService;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.cloud.stream.annotation.EnableBinding;
+import org.springframework.cloud.stream.config.BindingProperties;
+import org.springframework.cloud.stream.config.BindingServiceProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
+
+import java.util.Map;
+
+@EnableBinding({RabbitMessageChannel.class})
+@Configuration
+@EnableConfigurationProperties(BindingServiceProperties.class)
+@ConditionalOnProperty(value = "alpha.feature.akka.channel.type", havingValue = "rabbit")
+public class RabbitChannelAutoConfiguration {
+
+
+    @Bean
+    @ConditionalOnMissingBean()
+    public RabbitMessagePublisher rabbitMessagePublisher(BindingServiceProperties bindingServiceProperties, RabbitMessageChannel producerMessage) {
+        Map<String, BindingProperties> bindings = bindingServiceProperties.getBindings();
+        // 分区数量,现在现在生产者与消费这都在alpha-server,所以rabbit的分区partitionCount与该数量保持一直
+        int partitionCount = bindings.get(RabbitMessageChannel.SERVICE_COMB_PACK_PRODUCER).getProducer().getPartitionCount();
+        RabbitMessagePublisher messagePublisher = new RabbitMessagePublisher(partitionCount, producerMessage);
+        return messagePublisher;
+    }
+
+//    @StreamMessageConverter

Review comment:
       Please remove the commented code.




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

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



[GitHub] [servicecomb-pack] coolbeevip commented on pull request #691: FSM event channel supports Rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-806308677


   I created a JIRA https://issues.apache.org/jira/browse/SCB-2238 for this PR


-- 
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-801580504


   > William's
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] githubcheng2978 commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
githubcheng2978 commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-799965977


   @WillemJiang  麻烦看看我这个PR哪里还有问题呢


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [servicecomb-pack] coolbeevip commented on pull request #691: 支持rabbit

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on pull request #691:
URL: https://github.com/apache/servicecomb-pack/pull/691#issuecomment-800991925


   > > I trigger CI run via reopening this issue
   > 
   > so what should i do to resolve this problem
   
   We just migrated CI from Travis to Github Action, your PR has been pass CI.
   
   You need to modify the code according to William's suggestion and push it to [githubcheng2978:feature-rabbitmq](https://github.com/githubcheng2978/servicecomb-pack/tree/feature-rabbitmq) again


----------------------------------------------------------------
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:
users@infra.apache.org