Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: failureHandler implement can be read from the container #2370

Merged
merged 9 commits into from
Mar 25, 2020

Conversation

ph3636
Copy link
Contributor

@ph3636 ph3636 commented Mar 6, 2020

Ⅰ. Describe what this PR did

FailureHandler implement can be read from the container

Ⅱ. Does this pull request fix one issue?

#2353

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

codecov-io commented Mar 6, 2020

Codecov Report

❗ No coverage uploaded for pull request base (develop@1d468c4). Click here to learn what that means.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2370   +/-   ##
==========================================
  Coverage           ?   51.81%           
  Complexity         ?     2699           
==========================================
  Files              ?      517           
  Lines              ?    16761           
  Branches           ?     2028           
==========================================
  Hits               ?     8685           
  Misses             ?     7267           
  Partials           ?      809
Impacted Files Coverage Δ Complexity Δ
...ommon/src/main/java/io/seata/common/Constants.java 50% <ø> (ø) 1 <0> (?)
...ing/boot/autoconfigure/SeataAutoConfiguration.java 0% <0%> (ø) 0 <0> (?)
...ta/spring/annotation/GlobalTransactionScanner.java 52.12% <100%> (ø) 17 <1> (?)

Copy link
Contributor

@zjinlei zjinlei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not load it from the globalTransactionScanner in starter ?

@ph3636 ph3636 closed this Mar 11, 2020
@ph3636 ph3636 reopened this Mar 11, 2020
@ph3636
Copy link
Contributor Author

ph3636 commented Mar 11, 2020

Why not load it from the globalTransactionScanner in starter ?

You mean it's more appropriate?

@bean
@dependsOn({BEAN_NAME_SPRING_APPLICATION_CONTEXT_PROVIDER})
@ConditionalOnMissingBean(GlobalTransactionScanner.class)
public GlobalTransactionScanner globalTransactionScanner(SeataProperties seataProperties) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Automatically configure Seata");
}
FailureHandler customFailureHandler = null;
try {
customFailureHandler = ObjectHolder.INSTANCE.getObject(ApplicationContext.class).getBean(FailureHandler.class);
} catch (NoSuchBeanDefinitionException ignore) {
}
return new GlobalTransactionScanner(seataProperties.getApplicationId(), seataProperties.getTxServiceGroup(), customFailureHandler);
}

I think my approach is at the bottom of the way, no matter which way he chooses, it can ensure loading.

@zjinlei zjinlei added this to the 1.2.0 milestone Mar 12, 2020
@slievrly slievrly changed the title feature: FailureHandler implement can be read from the container feature: failureHandler implement can be read from the container Mar 25, 2020
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly merged commit 4f0dc00 into apache:develop Mar 25, 2020
@ph3636 ph3636 deleted the CustomFailureHandler branch March 27, 2020 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants