Skip to main content
Version: 5.0

Parameter Constraints and Suggestions

There are many custom parameters and resource names in the Apache RocketMQ system. You are advised to set the system according to the following instructions to avoid application exceptions caused by improper setting of certain parameters.

ParametersRecommended rangeInstructions
Topic nameCharacters suggest:a~z A~Z 0~9 ()(-)(%)
Suggested length:1~64 characters
System reserved character:The following reserved characters or characters with special prefixes are not allowed for topic names.
reserved characters: TBW102 BenchmarkTest SELF_TEST_TOPIC OFFSET_MOVED_EVENT SCHEDULE_TOPIC_XXXX RMQ_SYS_TRANS_HALF_TOPIC RMQ_SYS_TRACE_TOPIC RMQ_SYS_TRANS_OP_HALF_TOPIC
reserved prefix characters:
rmq_sys
%RETRY% %DLQ% rocketmq-broker-
Topic name should use short, common characters and avoid special characters. Special characters may cause exceptions in system parsing. If the characters are too long, messages may be rejected.
ConsumerGroup nameCharacters suggest:a~z A~Z 0~9 ()(-)(%)
Suggested length:1~64 characters
System reserved character:The following reserved characters or characters with special prefixes are not allowed for consumerGroup names.
reserved characters: DEFAULT_CONSUMER DEFAULT_PRODUCER TOOLS_CONSUMER FILTERSRV_CONSUMER __MONITOR_CONSUMER CLIENT_INNER_PRODUCER SELF_TEST_P_GROUP SELF_TEST_C_GROUP CID_ONS-HTTP-PROXY CID_ONSAPI_PERMISSION CID_ONSAPI_OWNER CID_ONSAPI_PULL CID_RMQ_SYS_TRANS reserved characters * CID_RMQ_SYS
* CID_HOUSEKEEPING
null
ACL credentialsCharacters suggest:AK(AccessKey ID)、SK(AccessKey Secret)and Token only support a~z A~Z 0~9
Suggested length:less than 1024 characters.
null
Request timeoutDefault value:3000ms.The request timeout duration is the waiting time for local synchronous invocation of clients. Set a proper value based on the actual application to avoid long thread blocking time.
Max message sizeDefault value:4 MB. Message compression is not involved, only the size of the message body is calculated.
Value range:Suggest less than 4 MB.
The message transmission should be compressed and the load should be controlled to avoid the transmission of large files.
Message custom propertiesCharacter limit:All visible characters.
Suggested length:Sum of all keys and values less than 16KB.
System reserved properties:The following reserved properties are not allowed as keys for custom properties. System reserved Keys
null
MessageGroupCharacter limit:All visible characters.
Suggested length:1~64.
Generally, messageGroup is set to a set of message identifiers that need to ensure order, such as order, user, etc.
Max number of message sending retriesDefault values:3 times.
Value range:No limits.
Sending retry policy is invisible to applications. A small value is recommended to avoid blocking service threads. If the message is not sent successfully after the maximum number of retries is reached, it is recommended that the service side perform backtracking to ensure message reliability.
Max number of message consume retriesDefault value:16 times.Consumption retry times set a proper value based on actual service requirements to avoid unlimited consumption retry times. If the number of retry times is too large, the system pressure increases.
Transaction exception check intervalDefault value:60 seconds.Transaction exception check interval refers to the interval at which semi-transaction messages are not committed due to system restart or abnormal conditions. The producer client will check back the transaction status according to this interval. Do not set the interval too short. Otherwise, the system performance may be affected by frequent callback calls.
Time of the first callback of a semi-transaction messageDefault value:Refer to [Transaction exception check interval] * Max check timesnull
Maximum timeout duration of semi-transaction messagesDefault value:4 Hour.If the semi-transaction message is not committed due to system restart or abnormal conditions, the producer client will check back according to the transaction exception check interval. If no result is returned after the timeout period of the semi-transaction message, the semi-transaction message will be forcibly rolled back.
PushConsumer sdk cacheDefault value:
Maximum cache num:1024
Maximum cache size:64 M.
The number and size of cached messages should be set to the limit allowed by system memory.
PushConsumer retry intervalsDefault value:
Concurrent deliver type:The interval time ladder changes.
Fifo deliver type:3000 ms.
null
PushConsumer consume threadsDefault value:20null
Get message batch sizeDefault value:32The consumer obtains the maximum number of messages from the server at a time. You are advised to set a proper parameter value based on actual services. If the number of messages obtained at one time is too large, a large number of messages may be duplicated when consumption fails.
SimpleConsumer max invisible timeDefault value:This parameter is mandatory and has no default value.
Suggested range:10 seconds to 12 hours.
Consumption invisible time refers to the total time between message processing and retry after failure. You are advised to set the value to a little longer than the actual time.