spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

refactor RocketMQProduceFactory: reuse producer

Open LeBW opened this issue 1 year ago • 1 comments

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

LeBW avatar Aug 08 '22 04:08 LeBW

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

Sorieee avatar Aug 08 '22 07:08 Sorieee

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

LeBW avatar Oct 24 '22 14:10 LeBW

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

steverao avatar Nov 16 '22 06:11 steverao