- Broker: add PopLiteLongPollingService to NotificationProcessor for lite consumer notification polling
- Broker: LiteEventDispatcher notifies both PopLiteMessageProcessor and NotificationProcessor polling services
- Broker: add hasEvents(clientId) API to LiteEventDispatcher for message availability check
- Proxy: unify lite/normal pop paths into single popMessage call, route by ProxyContext.isLiteConsumer()
- Proxy: register LITE_SIMPLE_CONSUMER in ClientActivity and GrpcClientSettingsManager lifecycle
- Proxy: pass liteTopic property only for lite consumers in filter and response writer
- Proxy: remove standalone popLiteMessage from MessagingProcessor/ConsumerProcessor
- Remoting: add isLiteConsumer and clientId fields to NotificationRequestHeader
- Remove cached consumerOffsetManager field from LiteEventDispatcher
- Replace all usages with brokerController.getConsumerOffsetManager() for lazy resolution
- Allows downstream projects to swap ConsumerOffsetManager after broker init
- DefaultMQProducerImpl#request(Message, RequestCallback, long): drop the
executeRequestCallback() call in the async send onSuccess so a send success
no longer delivers a premature onSuccess(null); align with the other async
request overloads which only set sendRequestOk here.
- RequestResponseFuture: add an AtomicBoolean executeCallbackOnlyOnce guard so
the callback fires at most once even if the reply and timeout paths race.
- RequestFutureHolder#scanExpiredRequest: use ConcurrentHashMap.remove(key) to
atomically claim ownership instead of iterator.remove(); also fix the log
placeholder concatenation.
- ClientRemotingProcessor#processReplyMessage: use atomic remove(correlationId)
and route the reply through executeRequestCallback so the single-shot guard
covers the reply-success path too.
- Add RequestResponseFutureTest cases for success-then-timeout and concurrent
single-callback semantics.
Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
DefaultElectPolicy sorted broker candidates by subtracting maxOffset values and casting the long delta to int. Large offset gaps can overflow the comparator result and rank a lower-offset broker first. This replaces subtraction with safe comparator helpers and adds a focused overflow regression test.
Constraint: Preserve existing election order: higher epoch, higher maxOffset, lower electionPriority
Rejected: Keep subtraction comparator | unsafe for long offset deltas greater than Integer.MAX_VALUE
Confidence: high
Scope-risk: narrow
Tested: mvn -q -pl controller -DskipTests=false -Dtest=DefaultElectPolicyTest -Djacoco.skip=true test
Tested: mvn -q -pl controller -DskipTests compile -Dspotbugs.skip=true -Dcheckstyle.skip=true
Tested: mvn -q -DskipTests compile -Dspotbugs.skip=true -Dcheckstyle.skip=true
Not-tested: Full controller suite on local JDK due existing JaCoCo/Hessian module-access failures
Related: #10578
- Replace consumerService.start() with consumerService.getPopConsumerStore().start()
- Replace consumerService.shutdown() with consumerService.getPopConsumerStore().shutdown()
- Avoid starting revive/cache background threads that are not needed for transferToFsStore verification
- Reduces test execution time from ~60s to ~1.3s
* [ISSUE #10560] Remove enableLiteEventMode config switch
- Remove enableLiteEventMode field, getter and setter from BrokerConfig
- Remove 5 early-return guard checks in LiteEventDispatcher
- Remove dead condition in PopLiteMessageProcessor.popLiteTopic
- Simplify getEventIterator to always use event-set path
- Delete unused LiteSubscriptionIterator inner class
- Remove disabled-mode test cases and stale Javadoc references
* chore: retrigger CI
Normalize horizontal rules, blank lines around headings and code
blocks, list markers, nested list indentation, and trailing whitespace
without changing content.
* [ISSUE #10549] Fix lite topic reset offset: memory leak, FIFO block bypass, and offset-0 reset failure
- Fix memory leak in removeResetOffset: clean up empty inner map entries from resetOffsetTable
- Add eraseResetOffset for precise cleanup on lite topic removal
- Skip FIFO block check in isFifoBlocked when server-side reset offset is pending
- Fix ResetOffsetByTimeCommand: change resetOffset > 0 to >= 0 to allow resetting to offset 0
- Add unit tests for eraseResetOffset and isFifoBlocked reset bypass
* chore: empty commit to trigger CI pipeline
BrokerMetricsManager.getMessageType(SendMessageRequestHeader) is called
once per send to classify the message. It internally decodes the
properties String into a HashMap, but the typical caller
(SendMessageProcessor) has already decoded the same String moments
before. The result is a redundant decode allocation per send (one
HashMap + ~14 String substrings + one Node[]).
This commit adds a public overload getMessageType(Map<String, String>)
that lets callers pass an already-decoded Map and reuse it. The
existing SendMessageRequestHeader overload now delegates to the new
overload; behavior is unchanged for callers that don't have a decoded
Map. Downstream callers (e.g. SendMessageProcessor) can switch to the
new overload in a separate broker-layer commit.
Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
Replace five outdated commands (updateAclConfig, deleteAccessConfig,
updateGlobalWhiteAddr, clusterAclConfigVersion, getAclConfig) with
the six commands available in RocketMQ 5.5.0:
createAcl, updateAcl, deleteAcl, getAcl, listAcl, copyAcl
Verified: all five old commands return 'sub command not exist' on
RocketMQ 5.5.0. Each new command documented with parameters and
usage examples from actual mqadmin -h output.
Fixes#10502
The two-argument constructors DefaultMQProducer(String, boolean) and
DefaultMQPushConsumer(String, boolean) do not exist in 5.x.
Updated to use the three-argument form with null for the default
trace topic.
Fixes#10500
* Update ACL mqadmin commands in Chinese doc Section 7
Replace five outdated commands (updateAclConfig, deleteAccessConfig,
updateGlobalWhiteAddr, clusterAclConfigVersion, getAclConfig) with
the six commands available in RocketMQ 5.5.0:
createAcl, updateAcl, deleteAcl, getAcl, listAcl, copyAcl
Verified: all five old commands return 'sub command not exist' on
RocketMQ 5.5.0. Each new command documented with parameters and
usage examples from actual mqadmin -h output.
Fixes#10502
* Fix off-by-one in BitsArray boundary checks and add unit tests
**Bug fix**
checkBytePosition and checkBitPosition used '>' instead of '>=',
allowing positions equal to array length to pass validation and
cause ArrayIndexOutOfBoundsException instead of the intended
IllegalArgumentException.
**Production impact if not fixed**
Minimal. getByte/setByte are only called internally by xor/or/and
with safe bounds. getBit/setBit positions come from BloomFilterData
hash functions which always produce in-range values. The incorrect
check has no known production trigger.
**Impact of fix**
Zero negative impact. All valid positions (0 to length-1) unchanged.
Edge case now correctly throws IllegalArgumentException instead of
ArrayIndexOutOfBoundsException.
**Tests added**
- BitsArrayTest: 27 tests covering create, bit/byte ops, boundary,
including regression tests for the fixed checks
- PlainAccessConfigTest: 12 tests for getters/setters, equals/hashCode
References #8262
* Remove self-comparison assertion flagged as error by CI
Previously, multiple catch blocks in StatsAllSubCommand silently
swallowed exceptions, making it difficult to diagnose issues when
the `mqadmin statsAll` command failed to retrieve statistics from
certain brokers.
This commit adds debug-level logging to all empty catch blocks,
recording the exception details along with contextual information
(topic, group, broker address) to improve observability.
Co-authored-by: fire <gloria_404@126.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
In asyncPutMessage() and asyncRemotePutMessageToSpecificQueue(), the
return value of tryToFindTopicPublishInfo() is dereferenced without a
null check, causing NullPointerException when topic route information
is unavailable (e.g., during startup or after nameserver disconnection).
This commit adds null/validity checks consistent with the existing
pattern in putMessageToRemoteBroker(), returning PUT_TO_REMOTE_BROKER_FAIL
with a warning log instead of crashing with NPE.
Co-authored-by: fire <gloria_404@126.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The 'Configuration' section linked to TieredMessageStoreConfig.java under
the tieredstore/common package, but that class has been renamed to
MessageStoreConfig and moved to the tieredstore package root, so the link
returns 404. Point it at the current MessageStoreConfig.java, which holds
the tiered store configuration fields documented in the table below
(tieredStoreFilePath, tieredBackendServiceProvider, tieredStorageLevel, ...).
Signed-off-by: fancy-agent <fancyboi66@gmail.com>
The Slack invite link (rocketmq-invite-automation.herokuapp.com) returns
HTTP 404 — the Heroku-hosted invite app is gone (Heroku retired free
dynos in Nov 2022). The project site no longer lists Slack anywhere
(home, docs, and the contact page have no Slack reference), so this
removes the dead link to keep the contact list accurate.
Signed-off-by: fancy-agent <fancyboi66@gmail.com>
- MessageClientIDSetter.createUniqID(): reuse a ThreadLocal<char[]>
instead of allocating a new char[LEN*2] on every send.
- MessageVersion.valueOfMagicCode(): replace Enum.values() array copy +
O(n) loop with direct if-else on the two known magic codes.
Co-authored-by: wangjiahua.wjh <wangjiahua.wjh@alibaba-inc.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>