Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Enhancement] FilterFactory duplicate-registration and unregister semantics lack tests

Open Beginner friendly
#11,340 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@chennaji9 is already working on this.

Since Oct 9, 2026.

  • #11349 by @chennaji9 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
testing

Research direction

Start with register, unRegister and get in filter/src/main/java/org/apache/rocketmq/filter/FilterFactory.java, then read the existing FilterSpiTest to see how it registers its one filter. Add cases for a duplicate type (expect IllegalArgumentException and the original instance kept), unregister returning the previous filter, get returning null afterwards, re-registration succeeding, and a second SqlFilter under SQL92 being rejected while the built-in filter still works. Run FilterSpiTest to confirm.

Written by the indexing model from the issue text.

Description

Description

FilterFactory (filter/src/main/java/org/apache/rocketmq/filter/FilterFactory.java) holds the registry of subscription filter SPIs used by the broker to compile subscriptions. Two of its guarantees have no test coverage:

  1. Duplicate registration is rejected, not overwritten: register throws IllegalArgumentException when the type already exists (Filter spi type(%s) already exist!). If this guard regressed to a silent overwrite, a custom filter could silently replace the built-in SQL92 filter for every broker in the process.
  2. Unregister/return semantics: unRegister returns the removed filter (so callers can restore it) and the type becomes registerable again.

The existing FilterSpiTest only registers one filter and uses it; it never exercises duplicates, unregister/re-register, or protection of the built-in SQL92 entry.

Expected behavior

Extend FilterSpiTest: duplicate type registration throws and keeps the original instance; unregister returns the previous filter, makes get return null, and allows a fresh registration; registering a second SqlFilter (built-in SQL92 type) is rejected and leaves the built-in filter functional.

Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
6d 16h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/rocketmq

All issues in apache/rocketmq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.