Test case and fix for http://jira.activemq.org/jira/browse/AMQ-618 Robert Newson, great job finding and putting together a test case for this.