{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/92","labels_url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/92/comments","events_url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/92/events","html_url":"https://github.com/spring-projects/spring-integration-kafka/issues/92","id":118671059,"number":92,"title":"How to Override the topic Name ","user":{"login":"ashishsoni","id":877509,"avatar_url":"https://avatars.githubusercontent.com/u/877509?v=3","gravatar_id":"","url":"https://api.github.com/users/ashishsoni","html_url":"https://github.com/ashishsoni","followers_url":"https://api.github.com/users/ashishsoni/followers","following_url":"https://api.github.com/users/ashishsoni/following{/other_user}","gists_url":"https://api.github.com/users/ashishsoni/gists{/gist_id}","starred_url":"https://api.github.com/users/ashishsoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashishsoni/subscriptions","organizations_url":"https://api.github.com/users/ashishsoni/orgs","repos_url":"https://api.github.com/users/ashishsoni/repos","events_url":"https://api.github.com/users/ashishsoni/events{/privacy}","received_events_url":"https://api.github.com/users/ashishsoni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-24T18:11:39Z","updated_at":"2015-11-24T19:29:12Z","closed_at":null,"body":"I am providing the topic name as below but i see the message still posted to the topic configure in the XML file\r\n\r\nPlease let me know what is missing \r\n````\r\n@Inject\r\n    MessageChannel inputToKafka;\r\n\r\n\r\n    public void sendMessageToKafka(String message) {\r\n        inputToKafka.send(\r\n                MessageBuilder.withPayload(message)\r\n                        .setHeader(KafkaHeaders.MESSAGE_KEY, \"1\")\r\n                        .setHeader(KafkaHeaders.TOPIC, \"newtopic\")\r\n                        .build());\r\n   }\r\n````\r\nXML File \r\n\r\n````\r\n<int-kafka:producer-context id=\"kafkaProducerContext\" >\r\n        <int-kafka:producer-configurations>\r\n            <int-kafka:producer-configuration broker-list=\"host:6667\"            \t\t   \r\n                       key-class-type=\"java.lang.String\"\r\n                       value-class-type=\"java.lang.String\"\r\n                       topic=\"sample\"\r\n                       value-serializer=\"kafkaSerializer\"\r\n                       key-serializer=\"kafkaSerializer\"\r\n                       compression-type=\"none\"/>\r\n        </int-kafka:producer-configurations>\r\n    </int-kafka:producer-context>\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/comments/159380721","html_url":"https://github.com/spring-projects/spring-integration-kafka/issues/92#issuecomment-159380721","issue_url":"https://api.github.com/repos/spring-projects/spring-integration-kafka/issues/92","id":159380721,"user":{"login":"mbogoevici","id":159684,"avatar_url":"https://avatars.githubusercontent.com/u/159684?v=3","gravatar_id":"","url":"https://api.github.com/users/mbogoevici","html_url":"https://github.com/mbogoevici","followers_url":"https://api.github.com/users/mbogoevici/followers","following_url":"https://api.github.com/users/mbogoevici/following{/other_user}","gists_url":"https://api.github.com/users/mbogoevici/gists{/gist_id}","starred_url":"https://api.github.com/users/mbogoevici/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbogoevici/subscriptions","organizations_url":"https://api.github.com/users/mbogoevici/orgs","repos_url":"https://api.github.com/users/mbogoevici/repos","events_url":"https://api.github.com/users/mbogoevici/events{/privacy}","received_events_url":"https://api.github.com/users/mbogoevici/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T19:29:12Z","updated_at":"2015-11-24T19:29:12Z","body":"I think we need to simplify this drastically, because if there's no `topic` and no header, the producer will fall back to the topic configured in the sole configuration of `KafkaProducerContext`, so there is still some kind of (non-obvious) default. \r\n"}}