{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/579","repository_url":"https://api.github.com/repos/spring-projects/spring-kafka","labels_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/579/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/579/comments","events_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/579/events","html_url":"https://github.com/spring-projects/spring-kafka/issues/579","id":298298130,"number":579,"title":"MessageConversionException if use @Payload and @Header","user":{"login":"dusan-eremic","id":8772768,"avatar_url":"https://avatars1.githubusercontent.com/u/8772768?v=4","gravatar_id":"","url":"https://api.github.com/users/dusan-eremic","html_url":"https://github.com/dusan-eremic","followers_url":"https://api.github.com/users/dusan-eremic/followers","following_url":"https://api.github.com/users/dusan-eremic/following{/other_user}","gists_url":"https://api.github.com/users/dusan-eremic/gists{/gist_id}","starred_url":"https://api.github.com/users/dusan-eremic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dusan-eremic/subscriptions","organizations_url":"https://api.github.com/users/dusan-eremic/orgs","repos_url":"https://api.github.com/users/dusan-eremic/repos","events_url":"https://api.github.com/users/dusan-eremic/events{/privacy}","received_events_url":"https://api.github.com/users/dusan-eremic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-19T14:39:14Z","updated_at":"2018-02-22T01:52:19Z","closed_at":"2018-02-22T01:52:19Z","author_association":"NONE","body":"Hi,\r\n \r\nI have a `@KafkaListener` that accepts a custom pojo message as a `@Payload` and that works fine. \r\n\r\nIf in addition to `@Payload` parameter I add `Header(KafkaHeaders.RECEIVED_TOPIC) String topic` as a second parameter likes this\r\n```\r\n@Override\r\n@KafkaListener(topics = \"${kafka.topic.fulfilment}\")\r\npublic void processOrder(@Payload FulfilmentMessage message, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic) \r\n```\r\n`MessageConversionException` gets thrown.\r\n\r\n> \r\n> Caused by: org.springframework.messaging.converter.MessageConversionException: Cannot handle message; nested exception is org.springframework.messaging.converter.MessageConversionException: Cannot convert from [com.dusan.service.model.FulfilmentMessage] to [java.lang.String] for GenericMessage [payload=FulfilmentMessage(correlationId=9edfb1f9abcc6, orderId=108737886056134563, created=1519050744972), headers={kafka_offset=14, kafka_receivedMessageKey=null, kafka_receivedPartitionId=2, kafka_receivedTopic=order-fulfilment}], failedMessage=GenericMessage [payload=FulfilmentMessage(correlationId=9edfb1f9abcc6, orderId=108737886056134563, created=1519050744972), headers={kafka_offset=14, kafka_receivedMessageKey=null, kafka_receivedPartitionId=2, kafka_receivedTopic=order-fulfilment}]\r\n> \t... 12 common frames omitted\r\n\r\n\r\nAny idea why this is happening?"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/comments/367540787","html_url":"https://github.com/spring-projects/spring-kafka/issues/579#issuecomment-367540787","issue_url":"https://api.github.com/repos/spring-projects/spring-kafka/issues/579","id":367540787,"user":{"login":"dusan-eremic","id":8772768,"avatar_url":"https://avatars1.githubusercontent.com/u/8772768?v=4","gravatar_id":"","url":"https://api.github.com/users/dusan-eremic","html_url":"https://github.com/dusan-eremic","followers_url":"https://api.github.com/users/dusan-eremic/followers","following_url":"https://api.github.com/users/dusan-eremic/following{/other_user}","gists_url":"https://api.github.com/users/dusan-eremic/gists{/gist_id}","starred_url":"https://api.github.com/users/dusan-eremic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dusan-eremic/subscriptions","organizations_url":"https://api.github.com/users/dusan-eremic/orgs","repos_url":"https://api.github.com/users/dusan-eremic/repos","events_url":"https://api.github.com/users/dusan-eremic/events{/privacy}","received_events_url":"https://api.github.com/users/dusan-eremic/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T01:52:19Z","updated_at":"2018-02-22T01:52:19Z","author_association":"NONE","body":"I'll close it now. \r\n\r\nThanks"}}
{"actor":{"display_login":"dusan-eremic"}}