[SCB-244] enable servicecomb and add demo#210
Conversation
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
|
This pr need java chassis 1.0.0-m2 |
WillemJiang
left a comment
There was a problem hiding this comment.
Please update the accept test with this demo at the same time.
| <artifactId>omega-transport-servicecomb</artifactId> | ||
|
|
||
| <properties> | ||
| <java-chassis.version>1.0.0-m2</java-chassis.version> |
There was a problem hiding this comment.
Java chassis version is used in the root pom, we don't need to define it here.
| try { | ||
| omegaContext = BeanUtils.getBean("omegaContext"); | ||
| } catch (NullPointerException npe) { | ||
| LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is disabled."); |
There was a problem hiding this comment.
The warning message need to updated.
SagaConsumerHandler is not disabled, it's just cannot inject transaction ID.
| LOCAL_TX_ID_KEY, | ||
| omegaContext.localTxId()); | ||
| } else { | ||
| LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is disabled."); |
There was a problem hiding this comment.
The SagaConsumerHandler just skip the work, the log level can be info.
| omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); | ||
| } | ||
| } else { | ||
| LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is disabled."); |
There was a problem hiding this comment.
The warning need to be updated.
| this.omegaContext = omegaContext; | ||
| if (omegaContext == null) { | ||
| LOG.info("The OmegaContext is not injected, The SagaProviderHander is disabled."); | ||
| private OmegaContext omegaContext; |
There was a problem hiding this comment.
It's better to use the final object to avoid the change from outside.
We could add a new construction method which set the omegaContext to be null.
| private final AsyncResponse asyncResponse = mock(AsyncResponse.class); | ||
|
|
||
| private final SagaConsumerHandler handler = new SagaConsumerHandler(omegaContext); | ||
| private final SagaConsumerHandler handler = new SagaConsumerHandler(); |
| <maven.compiler.source>1.8</maven.compiler.source> | ||
| <maven.compiler.target>1.8</maven.compiler.target> | ||
| <saga.version>0.3.0-SNAPSHOT</saga.version> | ||
| <java-chassis.version>1.0.0-m2</java-chassis.version> |
There was a problem hiding this comment.
we should inherited the version from root pom.xml
|
As the java-chassis 1.0.0-m2 is not released yet, you may need to use 1.0.0-m1 to get the CI passed. |
Signed-off-by: zhengyangyong <yangyong.zheng@huawei.com>
| context = BeanUtils.getBean("omegaContext"); | ||
| } catch (NullPointerException npe) { | ||
| LOG.warn("The OmegaContext is not injected, The SagaConsumerHandler is disabled."); | ||
| LOG.warn("SagaConsumerHandler is not disabled, it's just cannot inject transaction ID."); |
There was a problem hiding this comment.
The waring message should be "The OmegaContext is null, SagaConsumer cannot inject transaction ID"
Follow this checklist to help us incorporate your contribution quickly and easily:
[SCB-XXX] Fixes bug in ApproximateQuantiles, where you replaceSCB-XXXwith the appropriate JIRA issue.mvn clean installto make sure basic checks pass. A more thorough check will be performed on your pull request automatically.