I configured camel sql component to read data from from database table . I have "onConsume" parameter working when i read one row at a time , but doesn't work when i try to read multiple rows at a time using "maxMessagesPerPoll". Here is what i tried ...

**Working :** When i read one row at a time and update the row using onConsume . 

My consumer endpoint uri looks like :

```
sql:select * from REPORT where IS_VIOLATED != 'N' and TYPE = 'Provisioning'?consumer.delay=1000&consumer.onConsume=update REPORT set IS_VIOLATED = 'N' where REPORT_ID =:#REPORT_ID

```

**Not working :** When I configured camel's sql component to read configurable rows(using "maxMessagesPerPoll") . It reads multiple rows at a time but onConsume doesn't seem to work . I tried to tell camel to use IN operator and setting header value(REPORT\_ID) with a array of values for IN clause.

My consumer endpoint uri now looks like :

```
sql:select * from REPORT where IS_VIOLATED != 'N' and TYPE = 'Provisioning'?consumer.delay=1000&maxMessagesPerPoll=3&consumer.useIterator=false&consumer.onConsume=update REPORT set IS_VIOLATED = 'N' where REPORT_ID in(:#REPORT_ID)

```

I might be doing something wrong here. I did enough searching on this already and found related [post1](https://stackoverflow.com/questions/39035312/how-to-update-only-consumed-sql-rows-with-apache-camel-sql-component), [post2](https://stackoverflow.com/questions/50208286/in-clause-in-apache-camel-2-18?rq=1) . But it doesn't put me on correct path.

I need to be able to mark all the consumed rows to IS\_VIOLATED = 'N' .

Thanks for your help.