#kafka-client使用示例
###获取当前工具类
    var kafakclient=require('./util/kafka/kafka-client');
### 创建kafka的链接
    var client=kafakclient.getKafkaCLient('kafka-0.icos.city:29094');
###获取生产者对象
    var producer=kafakclient.getProducer(client,function(){
        console.log('chua')
    },function(){
        console.log(e)
    });
####使用上一步的生产对象发送消息
    参数说明：
        producer 为上一步的声场这对象
        payloads 为topic的数组集合
            topic包含如下参数：
                topic 为需要发送的事件topic名称
                message 为要发送的具体消息
                partition 为发送到kafka的那个partition，默认为0，可以不写，对应接受者时候选择的partition
###示例
    kafakclient.sendKafkaMessage(producer,[
        { topic: 'topic1', 'partition': 1，offset：1},
        { topic: 'topic2', 'partition': 0 }
    ],function(err,data){
        console.log("err:",err)
        console.log("data:",data)
    })
###使用创建的client来消费对应的消息。
    参数说明：
        client 为上一步创建的kafka链接
        topics 为要接受的数据集合
            topic包含如下参数：
                topic 为要接受的事件topic名称
                partition 对应的生产者发送到kafka的partition，默认为0，可以不写此属性
                offset 为偏移量，是从kafka的数据中第一个开始获取，默认是从第0个开始，此配置要在下面的options属性中fromOffset为true的时候起作用
        options kafka先关配置信息，可以为空，下面是这个配置的介绍
            groupId: 'kafka-node-group',//consumer group id, default `kafka-node-group`
            // Auto commit config
            autoCommit: true,
            autoCommitIntervalMs: 5000,
            // The max wait time is the maximum amount of time in milliseconds to block waiting if insufficient data is available at the time the request is issued, default 100ms
            fetchMaxWaitMs: 100,
            // This is the minimum number of bytes of messages that must be available to give a response, default 1 byte
            fetchMinBytes: 1,
            // The maximum bytes to include in the message set for this partition. This helps bound the size of the response.
            fetchMaxBytes: 1024 * 1024,
            // If set true, consumer will fetch message from the given offset in the payloads
            fromOffset: false,
            // If set to 'buffer', values will be returned as raw buffer objects.
            encoding: 'utf8',
            keyEncoding: 'utf8'
        handle 为几首消息的回调方法，
###示例
    kafakclient.getKafkaMessage(client,[
        { topic: 'topic1', messages: 'hi' , 'partition': 1,offset:2}
    ],{'autoCommit': false,fromOffset: false,},function(msg){
        console.log("============",msg)
    })    
###如果当前连接不需要长链可以执行
    kafakclient.closeKafaClient(client)这个方法关闭kafka
