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

refactor RocketMQProduceFactory: reuse producer #2699

Merged
merged 7 commits into from
Nov 16, 2022

Conversation

LeBW
Copy link
Contributor

@LeBW LeBW commented Aug 8, 2022

Describe what this PR does / why we need it

Refactor RocketMQProduceFactory: reuse producer

Does this pull request fix one issue?

Describe how you did it

  1. add a Map private static Map<String, DefaultMQProducer> producers = new HashMap<>(); to store producers in the factory.
  2. reuse the producer in the factory

Describe how to verify it

Create several output bindings, and the producer will be reused.

Special notes for reviews

Copy link
Contributor

@Sorieee Sorieee left a comment

Choose a reason for hiding this comment

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

存在一些代码规范、并发风险

@Sorieee
Copy link
Contributor

Sorieee commented Aug 8, 2022

Maybe Spring cloud stream had cache producer, we don't need to cache producer in spring cloud alibaba.
lQLPJxaSQP3GCDjNA4rNBROw6pTMheW3XzUC8LBK44DSAA_1299_906

LeBW added 3 commits August 17, 2022 21:25
2. Don't reuse TransactionMQProducer
3. Add `sendCallBack` to key
@LeBW LeBW requested a review from steverao August 23, 2022 02:18
@LeBW
Copy link
Contributor Author

LeBW commented Oct 24, 2022

@steverao @zkzlx @yuhuangbin This PR may be reviewed and merged

@yuhuangbin yuhuangbin merged commit 5e80d7c into alibaba:2.2.x Nov 16, 2022
@steverao
Copy link
Collaborator

Don't forget to create a same PR to branch of 2021.x.

@LeBW LeBW deleted the 2.2.x-feature-rocketmq branch December 5, 2022 03:48
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.

4 participants