You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/03/24 08:06:00 UTC

[jira] [Commented] (SCB-428) Add omegaUniquaIdGenerator to the omega id generator

    [ https://issues.apache.org/jira/browse/SCB-428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16412482#comment-16412482 ] 

ASF GitHub Bot commented on SCB-428:
------------------------------------

WillemJiang closed pull request #159: SCB-428 Changed idGenerator bean name omegaUniquaIdGenerator
URL: https://github.com/apache/incubator-servicecomb-saga/pull/159
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/OmegaSpringConfig.java b/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/OmegaSpringConfig.java
index fa4027b6..14220255 100644
--- a/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/OmegaSpringConfig.java
+++ b/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/OmegaSpringConfig.java
@@ -27,6 +27,8 @@
 import org.apache.servicecomb.saga.omega.format.MessageFormat;
 import org.apache.servicecomb.saga.omega.transaction.MessageHandler;
 import org.apache.servicecomb.saga.omega.transaction.MessageSender;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -35,13 +37,13 @@
 @Configuration
 class OmegaSpringConfig {
 
-  @Bean
+  @Bean(name = {"omegaUniqueIdGenerator"})
   IdGenerator<String> idGenerator() {
     return new UniqueIdGenerator();
   }
 
   @Bean
-  OmegaContext omegaContext(IdGenerator<String> idGenerator) {
+  OmegaContext omegaContext(@Qualifier("omegaUniqueIdGenerator") IdGenerator<String> idGenerator) {
     return new OmegaContext(idGenerator);
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Add omegaUniquaIdGenerator to the omega id generator
> ----------------------------------------------------
>
>                 Key: SCB-428
>                 URL: https://issues.apache.org/jira/browse/SCB-428
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>            Reporter: Willem Jiang
>            Priority: Major
>
> {{It's common that we may have different IdGenerator Bean in the Spring Boot project. We need to avoid the IdGenerator conflict here.}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)