}
private void sendExchangesThroughDroppingThrottler(List<Exchange> sentExchanges, int messages) throws Exception {
ProducerTemplate myTemplate = context.createProducerTemplate();
DirectEndpoint targetEndpoint = resolveMandatoryEndpoint("direct:sample", DirectEndpoint.class);
for (int i = 0; i < messages; i++) {
Exchange e = targetEndpoint.createExchange();
e.getIn().setBody("<message>" + i + "</message>");
// only send if we are still started
if (context.getStatus().isStarted()) {
myTemplate.send(targetEndpoint, e);
sentExchanges.add(e);