Handle custom JMS acknowledgment modes as client acknowledge#30619
Conversation
|
We could turn this around and implement protected boolean isClientAcknowledge(Session session) throws JMSException {
int mode = session.getAcknowledgeMode();
return (mode != Session.SESSION_TRANSACTED &&
mode != Session.AUTO_ACKNOWLEDGE &&
mode != Session.DUPS_OK_ACKNOWLEDGE);
}No specific configuration necessary then, so it would work out of the box for your scenario, I suppose? If that sounds feasible and you got some cycles left, feel free to update the PR accordingly and rebase it onto the 6.0.x branch for inclusion in 6.0.10. Otherwise we can try to implement that out-of-the-box approach ourselves next week. |
|
Thanks for the quick feedback Juergen.
Yes indeed, that would be perfect.
I missed this, and was wary about changing the default behavior in any way, but if there's no risk in doing explicit acknowledge for vendor specific acknowledge modes that not variants of client acknowledge then I'm all for it. I can update the PR according to your guidance tomorrow morning. |
This commit updates JmsAccessor to handle custom JMS acknowledgment modes as client acknowledge, which is useful when working with JMS providers that provide non-standard variations of CLIENT_ACKNOWLEDGE, such as AWS SQS and its UNORDERED_ACKNOWLEDGE mode.
This commit reduces the visibility of JmsAccessorTests and its test methods to package-private and removes unnecessary throws declarations.
7fb27d6 to
db2f1d6
Compare
|
PR updated according to feedback and rebased on |
This commit updates
JmsAccessorto handle custom JMS acknowledgmentmodes as client acknowledge, which is useful when working with JMS
providers that provide non-standard variations of
CLIENT_ACKNOWLEDGE,such as AWS SQS and its
UNORDERED_ACKNOWLEDGEmode.The workaround (a quite tedious one) that I'm using at the moment is to subclass
DefaultJmsListenerContainerFactoryandDefaultMessageListenerContainerand override#isClientAcknowledgeusing something like this:For reference, SQS
UNORDERED_ACKNOWLEDGEis described as: