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

AmqpMessage.reject() throws "Can't release non-received message." (copy-paste from release())

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

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:

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

  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/activemq

All issues in apache/activemq

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.