ruthst00 commented on issue #1878:
URL: https://github.com/apache/activemq/issues/1878#issuecomment-6900077267

   ## Triage: Valid, low-severity diagnostics bug
   (AI assisted)
   
   **Recommendation:** Keep open, remove `Stale`, and classify as an AMQP 
error-reporting bug or enhancement. No evidence here of a security 
vulnerability or incorrect rejection handling.
   
   ### Findings
   
   The reported omission is present in the checked-out `main` at `03a17a7f4` 
(`6.5.0-SNAPSHOT`):
   
   1. **Rejection is handled, but its error is discarded.**  
      
[`AmqpSender.delivery()`](https://github.com/apache/activemq/tree/main/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java#L279)
 recognizes `Rejected` and calls `settle(delivery, MessageAck.POISON_ACK_TYPE)` 
without reading `Rejected.getError()`.
   
   2. **The generated acknowledgement has no poison cause.**  
      
[`AmqpSender.settle()`](https://github.com/apache/activemq/tree/main/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpSender.java#L510)
 constructs the `MessageAck`, but never calls `setPoisonCause()`.
   
   3. **That omission loses useful DLQ diagnostics.**  
      
[`RegionBroker.sendToDeadLetterQueue()`](https://github.com/apache/activemq/tree/main/activemq-broker/src/main/java/org/apache/activemq/broker/region/RegionBroker.java#L825)
 writes the `dlqDeliveryFailureCause` property only when a poison cause is 
supplied.
   
   **Impact:** When an AMQP consumer rejects a message with an error condition 
and description, those details are not propagated into the broker’s DLQ 
failure-cause metadata. Poison-message handling still occurs, subject to 
configured broker policies. This is primarily an observability and 
troubleshooting gap.
   
   ### Suggested fix and acceptance criteria
   
   - Extract the optional `ErrorCondition` from `Rejected`.
   - Convert it into a broker-side `Throwable` and set it on the poison 
acknowledgement.
   - Preserve at least the condition symbol and description; decide explicitly 
whether to include the optional `info` map.
   - Leave settlement, redelivery, and DLQ routing behavior unchanged.
   - Handle absent errors and partially populated error conditions safely.
   
   Add regression coverage that rejects a message with a distinctive error, 
consumes it from the configured DLQ, and verifies `dlqDeliveryFailureCause` 
contains the details. Retain coverage for rejection without an error.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to