{"action":"closed","issue":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/254","repository_url":"https://api.github.com/repos/spring-projects/spring-kafka","labels_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/254/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/254/comments","events_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/254/events","html_url":"https://github.com/spring-projects/spring-kafka/issues/254","id":214810454,"node_id":"MDU6SXNzdWUyMTQ4MTA0NTQ=","number":254,"title":"Multiple consumer records being printed","user":{"login":"javacup","id":397774,"node_id":"MDQ6VXNlcjM5Nzc3NA==","avatar_url":"https://avatars0.githubusercontent.com/u/397774?v=4","gravatar_id":"","url":"https://api.github.com/users/javacup","html_url":"https://github.com/javacup","followers_url":"https://api.github.com/users/javacup/followers","following_url":"https://api.github.com/users/javacup/following{/other_user}","gists_url":"https://api.github.com/users/javacup/gists{/gist_id}","starred_url":"https://api.github.com/users/javacup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javacup/subscriptions","organizations_url":"https://api.github.com/users/javacup/orgs","repos_url":"https://api.github.com/users/javacup/repos","events_url":"https://api.github.com/users/javacup/events{/privacy}","received_events_url":"https://api.github.com/users/javacup/received_events","type":"User","site_admin":false},"labels":[{"id":376276515,"node_id":"MDU6TGFiZWwzNzYyNzY1MTU=","url":"https://api.github.com/repos/spring-projects/spring-kafka/labels/waiting%20for%20reporter","name":"waiting for reporter","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-16T19:16:01Z","updated_at":"2018-09-13T19:49:53Z","closed_at":"2018-09-13T19:49:53Z","author_association":"NONE","body":"Hi:\r\n\r\nI'm fairly new to kafka, and spring-kafka too. \r\n\r\nI have the following configuration for consumer:\r\n\r\n```\r\n\tprivate Map<String, Object> consumerConfigs() {\r\n\t\tMap<String, Object> props = new HashMap<>();\r\n\t\tprops.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, SERVER_URI);\r\n\t\tprops.put(ConsumerConfig.GROUP_ID_CONFIG, \"group\");\r\n\t\tprops.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, true);\r\n\t\tprops.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, \"100\");\r\n\t\tprops.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, \"15000\");\r\n\t\tprops.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, IntegerDeserializer.class);\r\n\t\tprops.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);\r\n\t\tprops.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, \"latest\"); \t\t\r\n\t\treturn props;\r\n\t}\r\n```\r\n\r\ntemplate send\r\n```\r\n\t\tString topic = \"unit-test\";\r\n\t\tString message = String.format(\"A new message from %s at %s\",topic, GsDate.getFormattedDate(new Date()));\r\n\t\t\r\n\t\tListenableFuture<SendResult<Integer, String>> future = kafkaTemplate.send(topic, message);\r\n\r\n```\r\n\r\nIn my message listener:\r\n```\r\n    @KafkaListener(topics = {\"unit-test\"})\r\n    public void listen2(ConsumerRecord<?, ?> record) {\r\n    \tString payload = (String) record.value();\r\n    \tString topic = record.topic();\r\n     \tSystem.out.println(String.format(\"Consuming from topic %s, : payload: %s\",topic,payload));\r\n    }    \r\n```\r\n\r\nOutput:\r\n```\r\nConsuming from topic unit-test, : payload: A new message from unit-test at 03/16/2017 11:27\r\nConsuming from topic unit-test, : payload: A new message from unit-test at 03/16/2017 11:33\r\nConsuming from topic unit-test, : payload: A new message from unit-test at 03/16/2017 11:37\r\n```\r\n\r\nI'm getting multiple consumer records being printed. How can I configure the system so I get the last message published to the kafka server? \r\n\r\nThanks\r\n"}}
{"actor":{"display_login":"garyrussell"}}