Open CodingOX opened 7 months ago
This exception indicates the pollingTime (awaitDuration) set by client is too small.
There are two configs related to pollingtime in proxy, grpcClientConsumerMinLongPollingTimeoutMillis (default=5s) and grpcClientConsumerMaxLongPollingTimeoutMillis (default=20s). Set the pollingTime within this range would be ok.
Related proxy codes: https://github.com/apache/rocketmq/blob/develop/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/consumer/ReceiveMessageActivity.java#L82
This exception indicates the pollingTime (awaitDuration) set by client is too small.
There are two configs related to pollingtime in proxy, grpcClientConsumerMinLongPollingTimeoutMillis (default=5s) and grpcClientConsumerMaxLongPollingTimeoutMillis (default=20s). Set the pollingTime within this range would be ok.
Related proxy codes:
develop
/proxy/src/main/java/org/apache/rocketmq/proxy/grpc/v2/consumer/ReceiveMessageActivity.java#L82
thanks, I consulted the relevant documents and did not find this suggestion. The code comments also did not mention this problem. In order to better help subsequent users, would you consider improving the documentation?
Can you describe what scenario requires about setting setAwaitDuration below 20 seconds.
Can you describe what scenario requires about setting setAwaitDuration below 20 seconds.
In my understanding, the awaitDuration
parameter allows me to fetch messages more promptly. During periods of low business activity, when a particular message is highly important yet the number of such messages may fall short of the maxMessageNum
threshold (which stems from the org.apache.rocketmq.client.apis.consumer.SimpleConsumer#receive(maxMessageNum, duration)
call), this parameter ensures a swift return nonetheless.
Alternatively, I might need to fallback to assigning the macMessageNum variable with a value of 1, which could potentially be less efficient.
Before Creating the Bug Report
[X] I found a bug, not just asking a question, which should be created in GitHub Discussions.
[X] I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
[X] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
Ubuntu 20.04
RocketMQ version
RocketMQ 5.2
JDK Version
JDK 17
Describe the Bug
Feedback for RocketMQ 5.2 version using SimpleConsumer mode:
I am encountering an issue when using the
SimpleConsumer
mode in RocketMQ version 5.2. Specifically, when I set thesetAwaitDuration
to a value less than 20 seconds, I receive the following error message:Here is the relevant Kotlin code snippet for reference:
It seems that the error is related to the
setAwaitDuration
parameter needing to be greater than 20 seconds for proper functioning. However, I require more flexibility in setting this duration for my use case. Could you provide guidance on how to resolve this issue or suggest any workarounds that would allow me to set anAwaitDuration
below 20 seconds without encountering this error?Steps to Reproduce
What Did You Expect to See?
Code can run well when setAwaitDuration
paramter < 20
secondsWhat Did You See Instead?
No
Additional Context
No response