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 2019/09/27 09:54:36 UTC

[GitHub] [servicecomb-pack] coolbeevip commented on a change in pull request #564: [SCB-1368] Scalability using Sharding from Akka Cluster

coolbeevip commented on a change in pull request #564: [SCB-1368] Scalability using Sharding from Akka Cluster
URL: https://github.com/apache/servicecomb-pack/pull/564#discussion_r328998409
 
 

 ##########
 File path: alpha/alpha-fsm/src/main/java/org/apache/servicecomb/pack/alpha/fsm/FsmAutoConfiguration.java
 ##########
 @@ -20,53 +20,50 @@
 import static org.apache.servicecomb.pack.alpha.fsm.spring.integration.akka.SagaDataExtension.SAGA_DATA_EXTENSION_PROVIDER;
 import static org.apache.servicecomb.pack.alpha.fsm.spring.integration.akka.SpringAkkaExtension.SPRING_EXTENSION_PROVIDER;
 
+import akka.actor.ActorRef;
 import akka.actor.ActorSystem;
+import akka.actor.Props;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 import java.util.Map;
 import javax.annotation.PostConstruct;
-import org.apache.servicecomb.pack.alpha.fsm.channel.ActiveMQActorEventChannel;
-import org.apache.servicecomb.pack.alpha.fsm.channel.kafka.KafkaMessagePublisher;
-import org.apache.servicecomb.pack.alpha.fsm.channel.redis.RedisMessagePublisher;
+import org.apache.servicecomb.pack.alpha.fsm.channel.kafka.KafkaChannelAutoConfiguration;
+import org.apache.servicecomb.pack.alpha.fsm.channel.memory.MemoryChannelAutoConfiguration;
+import org.apache.servicecomb.pack.alpha.fsm.channel.redis.RedisChannelAutoConfiguration;
 import org.apache.servicecomb.pack.alpha.fsm.metrics.MetricsService;
 import org.apache.servicecomb.pack.alpha.fsm.repository.NoneTransactionRepository;
+import org.apache.servicecomb.pack.alpha.fsm.repository.channel.DefaultTransactionRepositoryChannel;
 import org.apache.servicecomb.pack.alpha.fsm.repository.elasticsearch.ElasticsearchTransactionRepository;
 import org.apache.servicecomb.pack.alpha.fsm.repository.TransactionRepository;
-import org.apache.servicecomb.pack.alpha.fsm.repository.channel.MemoryTransactionRepositoryChannel;
 import org.apache.servicecomb.pack.alpha.fsm.repository.TransactionRepositoryChannel;
-import org.apache.servicecomb.pack.alpha.core.fsm.sink.ActorEventSink;
-import org.apache.servicecomb.pack.alpha.core.fsm.channel.ActorEventChannel;
-import org.apache.servicecomb.pack.alpha.fsm.channel.KafkaActorEventChannel;
-import org.apache.servicecomb.pack.alpha.fsm.channel.MemoryActorEventChannel;
-import org.apache.servicecomb.pack.alpha.fsm.channel.RedisActorEventChannel;
-import org.apache.servicecomb.pack.alpha.fsm.sink.SagaActorEventSender;
 import org.apache.servicecomb.pack.alpha.fsm.spring.integration.akka.AkkaConfigPropertyAdapter;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Lazy;
 import org.springframework.core.env.ConfigurableEnvironment;
 import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
 
 @Configuration
+@ImportAutoConfiguration({
+    MemoryChannelAutoConfiguration.class,
+    KafkaChannelAutoConfiguration.class,
+    RedisChannelAutoConfiguration.class})
 @ConditionalOnProperty(value = {"alpha.feature.akka.enabled"})
 public class FsmAutoConfiguration {
 
-  @Value("${alpha.feature.akka.channel.memory.size:-1}")
-  int memoryEventChannelMemorySize;
-
-  @Value("${alpha.feature.akka.transaction.repository.elasticsearch.batchSize:1000}")
+  // TODO
+  //  Size of bulk request, When this value is greater than 0, the batch data will be lost when the jvm crashes.
+  //  In the future, we can use Kafka to solve this problem instead of storing it directly in the ES.
 
 Review comment:
   > It could be useful to raise a JIRA issue for this feature and mark it as optional.
   
   Ok,I will create a JIRA for this feature

----------------------------------------------------------------
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


With regards,
Apache Git Services