Repository navigation
Enforce provider-only JMSX properties under strictCompliance - #1853
pradeep85841 wants to merge 5 commits into
Conversation
pradeep85841
commented
Mar 28, 2026
- Throws a MessageNotWriteableException if a client attempts to set JMSXDeliveryCount, JMSXRcvTimestamp, JMSXState, JMSXProducerTXID, or JMSXConsumerTXID.
- Client-set properties (like JMSXGroupID and JMSXGroupSeq) are completely bypassed and function normally.
- Added StrictComplianceProviderJMSXPropertyTest using an embedded BrokerService to explicitly verify both strict and legacy behaviors.
|
Hi @jbonofre, just a quick ping on this! The changes are pushed with JMSException and the corrected imports. Let me know if anything else is needed |
|
@pradeep85841 thanks ! Let me do a new pass. |
|
Updated the "Wait.waitFor" condition in "testNetworkAdvancedStatistics". The test now waits for the broker to finish updating its background metrics (like enqueues and dequeues) before doing the final checks. |
|
Hi @jbonofre , just checking in! Both the main PR updates (exception/imports) and the fix for the flaky CI test are pushed. Let me know if you can kick off the CI checks again! |
| // Strict Compliance Check For Provider-Set JMSX Properties | ||
| ActiveMQConnection conn = getConnection(); | ||
| if (conn != null && conn.isStrictCompliance()) { | ||
| if ("JMSXDeliveryCount".equals(name) || |
There was a problem hiding this comment.
I think a constant final public static set would make more sense here vs each property listed out by string name.
|
Is the network metrics fix commit already merged? That should probably be a separate PR that can be merged quickly |
c9e2e1e to
697086d
Compare
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Vector; | ||
| import java.util.*; |
There was a problem hiding this comment.
Please don't reduce imports to wildcard. It is a common IDE setting, but we don't have the code style rules applied to catch it.
|
@mattrpav, My IDE auto-collapsed them when I added the Set classes. I've expanded them back to explicit imports and updated my local settings so it won't happen again. The fix is pushed |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
| ActiveMQConnection conn = getConnection(); | ||
| if (conn != null && conn.isStrictCompliance()) { | ||
| if (STRICT_PROVIDER_JMSX_PROPERTIES.contains(name)) { | ||
| throw new JMSException("Provider-set JMSX property '" + name + "' cannot be set by a client under strict compliance."); |
There was a problem hiding this comment.
Please update this exception to throw MessageNotWriteableException to be spec-aligned.
|
Hi @mattrpav, I've updated the exception to MessageNotWriteableException. |
|
Replaced by [#2864] with @pradeep85841's commits retained |
* Enforce provider-only JMSX properties under strictCompliance * Address review feedback: Use JMSException and fix imports * Refactor JMSX property check to use static final Set * Expand wildcard java.util imports * Changed exception to MessageNotWriteableException * [#1853] Leave provider-set JMSX properties out when converting a foreign message On a strict connection, sending a message from another provider failed with MessageNotWriteableException when that message listed a property such as JMSXDeliveryCount. The conversion now leaves those properties out on a strict connection. transformMessage and copyProperties have an overload that takes a strictComplianceOverride flag. True copies the provider-set values even on a strict connection, for example when bridging. The consumer passes true for a message returned by a consumer transformer, since that message is on its way to the application. The set of property names is renamed to JMSX_PROVIDER_PROPERTIES. * Review feedback: Add JMSXAppID and JMSXUserID as provider-only properties * Review feedback: JMSException when app attempts to set provider set JMSX property * Suggested fixes from LLM --------- Co-authored-by: pradeep85841 <pradeep.kunchala15@gmail.com> Co-authored-by: Christopher L. Shannon <cshannon@apache.org>