{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/62","repository_url":"https://api.github.com/repos/spring-projects/spring-kafka","labels_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/62/comments","events_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/62/events","html_url":"https://github.com/spring-projects/spring-kafka/issues/62","id":153383063,"number":62,"title":"When using AckMode.MANUAL_IMMEDIATE, ack always fails for existing few messages on topic.","user":{"login":"shrikantpatel","id":4107205,"avatar_url":"https://avatars.githubusercontent.com/u/4107205?v=3","gravatar_id":"","url":"https://api.github.com/users/shrikantpatel","html_url":"https://github.com/shrikantpatel","followers_url":"https://api.github.com/users/shrikantpatel/followers","following_url":"https://api.github.com/users/shrikantpatel/following{/other_user}","gists_url":"https://api.github.com/users/shrikantpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/shrikantpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shrikantpatel/subscriptions","organizations_url":"https://api.github.com/users/shrikantpatel/orgs","repos_url":"https://api.github.com/users/shrikantpatel/repos","events_url":"https://api.github.com/users/shrikantpatel/events{/privacy}","received_events_url":"https://api.github.com/users/shrikantpatel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-projects/spring-kafka/labels/in%20pr","name":"in pr","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-06T05:53:33Z","updated_at":"2016-05-12T22:20:09Z","closed_at":"2016-05-12T22:20:09Z","body":"Using ConcurrentMessageListenerContainer, and setting concurrency to 1 for now (in future it may be greater than 1.)  Also set container.setAckMode(AckMode.MANUAL_IMMEDIATE)\r\n\r\nI am manually triggering acknowledge in onMessage();\r\n\r\n\t\tcontainer.setMessageListener(new AcknowledgingMessageListener<K, V>() {\r\n\t\t\t@Override\r\n\t\t\tpublic void onMessage(ConsumerRecord<K, V> message, Acknowledgment ack) {\r\n\t\t                      logger.warn(\"**************************\");\r\n\t\t                      logger.warn(\"event id - \" + event.getEventId());\r\n\t\t                      logger.warn(\"**************************\");\r\n\t\t\t\t      ack.acknowledge();\r\n\t\t\t}\r\n\t\t});\r\n\r\nWhen there are messages already on topic, the acknowledge succeeds for first few messages on topic, but it fails for remaining messages. Once the consumer catches up, the acknowledge for subsequent message (event id -7 ie offset 8 onwards in below log) don't fail.\r\n\r\nWhy this happens?? Am i doing anything wrong.\r\n\r\n2016-05-06 00:10:39.946  INFO 275200 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka version : 0.9.0.1\r\n2016-05-06 00:10:39.946  INFO 275200 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka commitId : 23c69d62a0cabf06\r\n2016-05-06 00:10:40.214  INFO 275200 --- [        kafka-1] o.s.k.l.KafkaMessageListenerContainer    : partitions revoked:[]\r\n2016-05-06 00:10:40.323  INFO 275200 --- [        kafka-1] o.s.k.l.KafkaMessageListenerContainer    : partitions assigned:[my-topic-0]\r\n2016-05-06 00:10:40.402  INFO 275200 --- [        kafka-1] o.a.k.c.consumer.internals.Fetcher       : Fetch offset 87 is out of range, resetting offset\r\n2016-05-06 00:10:40.511  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.511  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 0\r\n2016-05-06 00:10:40.511  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 1\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 2\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 3\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 4\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 5\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 6\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : event id - 7\r\n2016-05-06 00:10:40.558  WARN 275200 --- [        kafka-1] c.p.subscriber.SampleEventSubscriber     : **************************\r\n2016-05-06 00:10:40.558 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=3, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null\r\n\r\n2016-05-06 00:10:40.574 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=4, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null\r\n\r\n2016-05-06 00:10:40.574 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=5, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null\r\n\r\n2016-05-06 00:10:40.574 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=6, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null\r\n\r\n2016-05-06 00:10:40.574 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=7, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null\r\n\r\n2016-05-06 00:10:40.574 ERROR 275200 --- [        kafka-1] o.a.k.c.consumer.OffsetCommitCallback    : Commit failed for {my-topic-0=OffsetAndMetadata{offset=8, metadata=''}}\r\n\r\norg.apache.kafka.clients.consumer.internals.SendFailedException: null"}}