You could try to filter using a singleton holding first-ness state:
public static class FirstOrNot {
private static FirstOrNot _instance;
public synchronized boolean isfirst() {
if ( _instance == null ) {
_instance = new FirstOrNot();
return true;
}
return false;
}
}
FirstOrNot first = new FirstOrNot();
from("webspheremq:topic:SNAPSHOTS")
.filter().method( first , "isFirst" )
.to("direct:anotherqueue")
Perhaps you can use this as a starting point.
Cheers,