AmqpMessage.reject() throws "Can't release non-received message." (copy-paste from release())
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 95/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java
- Domain
- testing-qa
Research direction
Open activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java and read the reject() guard alongside release(), accept(), and modify(). Reproduce the no-receiver scenario from the issue, then verify that reject() reports the reject operation and that the existing IllegalStateException behavior remains otherwise unchanged.
Written by the indexing model from the issue text.
Description
Component: activemq-amqp — AMQP test client (src/test/java)
Version: present on main as of 2026-09-28, commit c339114e
Environment: not applicable — the defect is a compile-time string constant, independent of JVM, container and configuration.
Description
In AmqpMessage.java, the guard in reject() throws an IllegalStateException whose message names
the wrong operation. It is identical to the one thrown by release() directly above it:
- line 208,
release()—"Can't release non-received message."(correct) - line 221,
reject()—"Can't release non-received message."(should say "reject")
The sibling guards each name their own operation, so the intended text is unambiguous:
148
and 177
"Can't accept non-received message.",
195
"Can't modify non-received message.".
git blame traces the line to f71e0ee15b2c456dac28cf456deafb764221afa6 (2016-10-11), the commit
that added reject(), so the wording appears to be a copy-paste from release() rather than a
later regression.
Impact
Test-only and minor. This is the AMQP test client, not broker code, so there is no runtime effect on
users. The cost is diagnostic: a test that calls reject() on a message that was never received
reports a release failure, pointing whoever debugs it at the wrong method.
Steps to reproduce
AmqpMessage msg = new AmqpMessage(); // no receiver
try {
msg.reject();
fail("expected IllegalStateException");
} catch (IllegalStateException e) {
// actual: "Can't release non-received message."
// expected: "Can't reject non-received message."
}
Proposed fix
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java
@@ (reject(), line 221)
public void reject() throws Exception {
if (receiver == null) {
- throw new IllegalStateException("Can't release non-received message.");
+ throw new IllegalStateException("Can't reject non-received message.");
}
I searched the open and closed GitHub issues and the AMQ JIRA project and did not find an existing
report. Happy to open a PR with this if it is welcome.
Provenance
This was found during an academic study of LLM-assisted code review at Jeonbuk National University, Jeonju, South Korea. An
automated LLM-based reviewer produced the initial analysis, and I verified it by reading the source at
c339114e. I am disclosing the origin in line with project norms on AI-assisted reports. I believe
it is a genuine, if trivial, defect and will respect your triage either way.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1.5k
- Avg merge
- 14h 42m
- Merged PRs (30d)
- 85
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/activemq
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
apache/activemq#2558 · 2 comments ·
Maintainers usually reply within 1 day
-
Stale
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/activemq#1999 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
apache/activemq#1871 · 2 comments ·
Maintainers usually reply within 1 day
-
Topic expiry task loads the whole JDBC topic store into the heap on PostgreSQL (AMQ-6067 fix is ineffective with pgjdbc)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
apache/activemq#2630 · 3 comments ·
Maintainers usually reply within 1 day
-
feat: Producer send rules and conversion tablePossibly taken @mattrpav claimed this 14 days ago. Open
apache/activemq#2604 · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Clock.MakeTime fails to validate hour, minute, and second ranges due to inert Calendar.set try-catchOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
mit-cml/appinventor-sources#4139 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Vakore/ZappierGames#81 ·
-
proposal
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
beemdevelopment/Aegis#1843 · 1 reaction ·
-
[Bug] Logo style setting missing and `classic` style not applied across multiple platforms (v3.1.0)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Stirling-Tools/Stirling-PDF#8382 · 1 reaction ·
Maintainers usually reply within 2 days
-
>enhancement needs:triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
elastic/elasticsearch#161191 ·
Maintainers usually reply within 1 day