I have something where I basically always want to lose the first record in a list. It will always be of the form List<String> – and I don’t care about the ‘header’ – which will always be the first element in the list and don’t want it sent to my endpoint
[ “header”, “message1”, “message2” … ]
.from( A ) // this sends Lists of StringBuffers. The first in the list will be header
.split().body() // now I have each
.to( B )
I would ideally like to lose the first message in the exchange and am thinking about the correct query to construct for it.
Something like ( this doesn’t work – removeMessage isn’t an camel option )
from( A )
.removeMessage( 0 ) // remove first message - this doesn't actually exist
.split().body().
.to( B )
I am looking at creating a filter which removes based on the CamelSplitIndex attribute on the exchange, but have at this point stopped and am wondering ‘am I going about this the right way?’
I did it pretty much as I suggested, and similar to what the other guy suggested, but without using the Simple expression language, which (ironically) seems simpler to me
.split().body()
.filter( header( “CamelSplitIndex” ).isNotEqual( 0 ) )