You have not been listening to a word I've been saying.
// block consuming for 5 seconds Thread.sleep(5000); processed++;
If you do this, it is a not a problem for the JMS Server.
The JMS Server has given you a message when it wasn't expired.
It is your fault that you did not process it until after it expired.
Actually, Carlo and I had a discussion about this yesterday and I believe the issue is clearer. This post is 'outdated' at this point.
Ideally the question is do we want to take action when a message has expired en route. As you pointed out in the JIRA we could simply add this as an interceptor as a QOS feature. Similarly, the adatper could do this as well but I am more inclinded to have it outside of the JCA stuff. It really is an interceptor type task.