Skip to content

Conversation

@seaHeater
Copy link

AsyncProducer shutdown after send async message done

What is the purpose of the change

fix issue478

Brief changelog

shutdown after send async message done

Verifying this change

run AsyncProducer

2 OK 0A1E0BBA0FD718B4AAC289580B880000
3 OK 0A1E0BBA0FD718B4AAC289580B8E0003
4 OK 0A1E0BBA0FD718B4AAC289580B910004
1 OK 0A1E0BBA0FD718B4AAC289580B880001

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

producer shutdown after send async message done
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 42.423% when pulling 99ac340 on seaHeater:master into a220364 on apache:master.

@wlliqipeng
Copy link
Contributor

It seems ok to add Thread.sleep,and why do you change loop times from 10000000 to 1000? Do you have any special considerations?

@seaHeater
Copy link
Author

If we use async send message, local broker will receive too much requests, and will lead to flow controll, so I reduced loop times.

org.apache.rocketmq.client.exception.MQBrokerException: CODE: 2 DESC: [TIMEOUT_CLEAN_QUEUE]broker busy, start flow control for a while, period in queue: 200ms, size of queue: 115

@dongeforever
Copy link
Member

@seaHeater How about using a semaphore instead of Thread.sleep?
It seems better to release a semaphore in SendCallBack.

@duhengforever
Copy link
Contributor

This issue has been resolved.

@oneslideicywater
Copy link

could you please update the quickstart, the message given in the console is quite misleading: No route info for topic xx, I waste many times checking my setup.

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.

6 participants