INTEXT-81 Fixing bug in decoding message streams

* adding a null check on the key decoder

https://jira.springsource.org/browse/INTEXT-81
This commit is contained in:
Kevin Eustice
2013-07-12 11:14:25 -07:00
committed by Gunnar Hillert
parent e1f400e2cf
commit 86be5e1b78

View File

@@ -182,10 +182,11 @@ public class ConsumerConfiguration {
@SuppressWarnings("unchecked")
public Map<String, List<KafkaStream<byte[], byte[]>>> getConsumerMapWithMessageStreams() {
if (consumerMetadata.getValueDecoder() != null) {
if (consumerMetadata.getValueDecoder() != null &&
consumerMetadata.getKeyDecoder() != null) {
return getConsumerConnector().createMessageStreams(
consumerMetadata.getTopicStreamMap(),
consumerMetadata.getValueDecoder(),
consumerMetadata.getKeyDecoder(),
consumerMetadata.getValueDecoder());
}