ARTEMIS-6370 AMQP large message delivery loop on short body An AMQP large message whose stored body is smaller than the body size recorded for it put the broker into an unrecoverable retry loop. The streaming loop in AMQPLargeMessageWriter passed the result of LargeBodyReader.readInto straight into ByteBuf.writerIndex, so the -1 that a sequential file read returns at end of file raised an IndexOutOfBoundsException naming a writerIndex of -1. That reached ProtonServerSenderContext.reportDeliveryError, which removed the consumer and handed the reference back to the queue, so the next consumer to attach failed the same way and the queue logged AMQ222151 indefinitely while delivering nothing. A zero length read had the same cause and spun the loop instead of raising anything. The writer now checks the read before it is used and raises a dedicated ActiveMQAMQPLargeMessageBodyTooSmallException, and the sender sends that one condition to the dead letter address rather than retrying a delivery that can never complete. It goes through ServerConsumer reject so the reference leaves the consumer's delivering list before the link is torn down, because the teardown would otherwise return the message to the queue and the loop would survive. The link is still closed, as a partial transfer may already be on the wire and proton-j cannot abort one. AMQPTunneledCoreLargeMessageWriter, which streams core large messages over broker connections, had the same unguarded read. A negative read there was added to the frame buffer writer index and to the position, rewinding both until the writer index underflowed and raised the same IndexOutOfBoundsException, while a zero length read spun silently. It now raises the same error, and because it already reports through reportDeliveryError it is dead lettered the same way. AMQPSessionCallback.disconnect also dereferenced a protocol context that the preceding consumer close clears on the queue executor, so the teardown raised a NullPointerException of its own. It now checks for null the way hasCredits in the same class already does. Assisted-by: Claude Code (Opus 5) on behalf of Antonio Gagliardi
Apache Artemis™ is multi-protocol message broker, supporting various industry standard protocols such as AMQP 1.0, MQTT 3.1.1, MQTT 5, and STOMP. This enables users to connect from across a broad range of languages and platforms, using clients written in Java, JavaScript, C, C++, Python, .Net, and more. Artemis offers the power and flexibility to support your messaging use-case.
See the User Manual for an in-depth explanation of all aspects of broker configuration and behavior.
The Artemis Examples repository contains over 90 examples demonstrating many of the client and broker features.
See the Hacking Guide for details about modifying the code, building the project, running tests, etc.
Apache Artemis releases are available on the Apache Artemis website. We do not distribute releases via GitHub.
See our website for details on how to report an bug, request a feature, etc.
Get in touch with folks in the community using an official Apache mailing list or the Apache Slack instance. Details are available on the Apache Artemis website.
Want to contribute? Details are available on the Apache Artemis website.