Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    邓冬林
    @972325986
    我换成信号量模式应该可以,我觉得是线程隔离的问题
    Lei Zhang
    @coolbeevip

    @SagaStart
    public void ServiceAdoSomething(){

    dao.insertDb() // 这里模拟异常
    
    serviceB.something() //这里调用服务B

    }

    @SagaStart
    public void ServiceAdoSomething(){
    
        dao.insertDb() // 这里模拟异常
    
        serviceB.something() //这里调用服务B
    }
    你是这样的场景?
    邓冬林
    @972325986
    是的
    Lei Zhang
    @coolbeevip
    dao.insertDb() 异常后 serviceB.something()这个就执行不到才对啊
    邓冬林
    @972325986
    我看看我这里是几个线程
    a服务是在调用b服务之后提交的事务
    不对不对,我再试试
    邓冬林
    @972325986
    我觉得我应该让A服务在出错的情况下不再访问B服务
    Lei Zhang
    @coolbeevip
    对啊,这应该是研发人员自己控制的
    邓冬林
    @972325986
    ok了,谢啦。
    Lei Zhang
    @coolbeevip
    😁
    Willem Jiang
    @WillemJiang
    @972325986 问题是如何解决的? 可以整理一条FAQ吗, 这样可以帮到跟你有同样问题的朋友。
    邓冬林
    @972325986
    可以的
    Willem Jiang
    @WillemJiang
    整理好可以往这 https://github.com/apache/servicecomb-pack/blob/master/FAQ_ZH.md 提一个PR, 如果能提供英文版就更好了。
    哦,因为现在我们是通过thread local来传递 调用信息的, 使用hystrix 如果出现线程切换是会有问题的。
    damoncl
    @damoncl
    我用feign 远程调用服务的时候引入了omega-transport-feign 然后启动报错Caused by: java.io.FileNotFoundException: class path resource [org/apache/servicecomb/saga/omega/transport/feign/FeignAutoConfiguration.class] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
    Lei Zhang
    @coolbeevip
    @damoncl 这个引入了吗
    <dependency>
    <groupId>org.apache.servicecomb.pack</groupId>
    <artifactId>omega-transport-resttemplate</artifactId>
    </dependency>
    Lei Zhang
    @coolbeevip
    @comnkey 发现一个问题,KafkaMessagePublisher中send时没有指定分区策略,应该按照globalTxId设置分区策略
    cmonkey
    @cmonkey
    好,我找个时间改一下,今天可能不行,再做支持
    Lei Zhang
    @coolbeevip
    @cmonkey OK
    Willem Jiang
    @WillemJiang
    @coolbeevip @cmonkey 准备下周cut release, 大家可以抽空测试一下snapshot release kit
    Willem Jiang
    @WillemJiang
    @coolbeevip I just add a comment on https://issues.apache.org/jira/browse/SCB-1438
    Just want to know why do we change it to static variable.
    Lei Zhang
    @coolbeevip
    @WillemJiang I replied to you
    @WillemJiang I am not sure about this problem, but it does solve this problem.
    Lei Zhang
    @coolbeevip
    @WillemJiang I know the cause of the error, I will update this PR quickly.
    Lei Zhang
    @coolbeevip
    @cmonkey 关于kafka通道我建立了一个JIRA https://issues.apache.org/jira/browse/SCB-1442,我提了两点改进建议,1是发送消息时需要使用 globalTxId作为分区策略,这样可以保证在多个消费者情况下同一个全局事务的子事务能被唯一一个消费者有序消费,2是在自动创建topic的时候能设置一个默认分区数,我建议可以给个默认数6,并且允许用户通过参数指定,关于自动创建topic并指定分区数,你可以参考一下这个https://www.baeldung.com/spring-kafka
    Willem Jiang
    @WillemJiang
    @coolbeevip Thx
    cmonkey
    @cmonkey
    @coolbeevip 帮重启一下2023
    Lei Zhang
    @coolbeevip
    I just add a comment for the latest PR.
    cmonkey
    @cmonkey
    @WillemJiang <java.chassis.version>1.2.1</java.chassis.version> 这有计划升级吗,他们的版本还是spring boot 1.5.x , 导致在pack 中有1.5.x 的依赖
    Willem Jiang
    @WillemJiang
    java chassis 最新版就是1.2.1
    如果不适用servicecomb transport的话应该不会引入spring boot 1.5.x吧
    其实Java chassis应该也支持spring boot 2.x的,应该可以重载一下的。 我抽空看一下。
    Willem Jiang
    @WillemJiang
    @cmonkey 我查了一下ServiceComb transport 的依赖,java-chassis-core 的依赖是provided, 也就是说你可以从设置相关的依赖。 java-chassis 有spring-boot2的starter https://github.com/apache/servicecomb-java-chassis/tree/master/java-chassis-spring-boot/spring-boot2-starter-parent 也有spring-boot2的依赖包管理 https://github.com/apache/servicecomb-java-chassis/blob/master/java-chassis-dependencies/springboot2/pom.xml
    cmonkey
    @cmonkey
    好的
    hahaxiou
    @hahaxiou
    Error creating bean with name 'compensableAnnotationProcessor' defined in class path resource [org/apache/servicecomb/pack/omega/transaction/spring/TransactionAspectConfig.class]: Unsatisfied dependency expressed through method 'compensableAnnotationProcessor' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.servicecomb.pack.omeg
    启动报错
    这个是因为什么?
    cmonkey
    @cmonkey
    日志少了点
    hahaxiou
    @hahaxiou
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.servicecomb.pack.omega.context.OmegaContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:818)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
    这样的
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'compensableAnnotationProcessor' defined in class path resource [org/apache/servicecomb/pack/omega/transaction/spring/TransactionAspectConfig.class]: Unsatisfied dependency expressed through method 'compensableAnnotationProcessor' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.servicecomb.pack.omega.context.OmegaContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:732)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:474)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1247)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:236)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:710)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:330)
    at com.open.capacity.UserCenterApp.main(UserCenterApp.java:38)
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.apache.servicecomb.pack.omega.context.OmegaContext' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1506)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1101)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:818)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:724)
    ... 17 common frames omitted
    hahaxiou
    @hahaxiou
    有碰到这个问题吗
    Willem Jiang
    @WillemJiang
    @hahaxiou 你用的是什么版本?
    在你的SpringBoot应用里面, 你有使用@EnableOmega吗?