Giter VIP home page Giter VIP logo

franz's People

Contributors

kellanburket avatar lewissk avatar lukel97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

franz's Issues

Unable to connect to my Kafka Server in local

I'm testing your kafka client
I don' t really know kafka but i have to plug to it from iOS Application.

I tried your client in a local mode :
I set up local kafka using https://kafka.apache.org/documentation.html#quickstart

in swift code i use
BioKafkaInterface(ip: "127.0.0.1", port: 2181, clientId: "", groupId: "test-consumer-group", partition: 0, topic: "test");

Where BioKafkaInterface is :

import Foundation
import ReactiveCocoa

@objc class BioKafkaInterface: NSObject, BioCommunicator, HighLevelConsumerDelegate {

let cluster : Cluster


init(ip:String, port:Int, clientId:String, groupId:String, partition:Int, topic:String) {
    print("init ip string")
    self.cluster = Cluster(brokers:[(ip, Int32(port))], clientId:clientId);
    super.init()
    self.cluster.getHighLevelConsumer(topic, partition: Int32(partition), groupId: groupId, delegate:self)

}

func read(size:UInt) -> Signal<[Int8], NSError> {
    return Signal.empty
}

func write(data:[Int8]) -> SignalProducer<Int, NSError> {
    return SignalProducer.empty;
}

func consumerDidReturnMessage(message: Message, offset: Int64) {
    print(NSString(data: message.value, encoding: NSUTF8StringEncoding))
}

func consumerIsReady(consumer: Consumer) {
    print("Consummer is ready")
    if let highLevelConsumer = consumer as? HighLevelConsumer {
        print("\(highLevelConsumer.broker?.description)")
        highLevelConsumer.poll()
    }
}


func shouldCommitOffset(topic: String, partition: Int32, offset: Int64) -> Bool {
    print("shouldCommitOffset \(topic, partition, offset)")
    return true
}

func shouldAttachOffsetMetadata(topic: String, partition: Int32, offset: Int64) -> String? {
    print("shouldAttachOffsetMetadata \(topic, partition, offset)")
    return "toto"
}

func offsetDidCommit(topic: String, partition: Int32, offset: Int64) {
    print("offsetDidCommit \(topic, partition, offset)")
}

func offsetCommitDidFail(topic: String, partition: Int32, offset: Int64, errorId: Int16, errorDescription: String) {
    print("offsetCommitDidFail \(topic, partition, offset, errorId, errorDescription)")
}


func shouldRetryFailedOffsetCommit(topic: String, partition: Int32, offset: Int64, errorId: Int16, errorDescription: String) -> Bool {
    print("shouldRetryFailedOffsetCommit \(topic, partition, offset, errorId, errorDescription)")
    return true;
}



func fetchDidFail(
    topic: String,
    partition: Int32,
    errorId: Int16,
    errorDescription: String
    ) {
        print("fetchDidFail \(topic, partition, errorId, errorDescription)");
}

func shouldRetryFailedFetch(
    topic: String,
    partition: Int32,
    errorId: Int16,
    errorDescription: String
    ) -> Bool {
                    print("shouldRetryFailedFetch \(topic, partition, errorId, errorDescription)");
        return true
}

func topicPartitionLeaderNotFound(topic: String, partition: Int32) {
    print("topicPartitionLeaderNotFound \(topic, partition) ");
}

}

The error in my log are :
INPUT STREAM STATUS: End
Zero Lenth Response

Log from zookeeper :
INFO Accepted socket connection from /127.0.0.1:49591 (org.apache.zookeeper.server.NIOServerCnxnFactory)
[2016-03-08 11:20:46,397] WARN Exception causing close of session 0x0 due to java.io.IOException: Unreasonable length = 1915578226 (org.apache.zookeeper.server.NIOServerCnxn)
[2016-03-08 11:20:46,397] INFO Closed socket connection for client /127.0.0.1:49591 (no session established for client) (org.apache.zookeeper.server.NIOServerCnxn)

Have you any idea what's going on there?
Co you have a solution, or an alternative to use kafka client

Misbehaving of consumer.listen Thread 6: EXC_BREAKPOINT (code=1, subcode=0x180c5b014)

I Implemented my franz consumer following the step but for some reasons consumer gets data without problem but on other run or build get exception in thread

on this line let start = prefix(upTo: startIndex + first) please help me to get how to resolve it.

Here in my code

`class KafkaViewModel: ObservableObject {
@published var receivedMessages: [String] = []
let cluster: Cluster
let consumer: Consumer

init() {
    self.cluster = Cluster(brokers: [("localhost", 9092)], clientId: "data")
    self.consumer = self.cluster.getConsumer(topics: ["data-grid"], groupId: "data")

    self.cluster.sendMessage("data-grid", message: "Grid data")
    print("hello")
    self.consumer.listen { [weak self] message in
        DispatchQueue.main.async {
            if let messageString = String(data: message.value, encoding: .utf8) {
                print(messageString)
                self?.receivedMessages.append(messageString)
            } else {
                print("Error: Failed to decode message data as UTF-8 string")
            }
        }
    }


    // No need to subscribe separately; topics are provided during consumer creation
    // Example of sending a message (move this to appropriate place)

// self.cluster.sendMessage("quickstart-events", message: "Hello world! 2")
}
}`

Problem with large message

I tried to sent a large message(1-2MB) and didn't work. I believe that happen because of "max.request.size" property. I looked in code after this property, or where i can put it, but i didn't figure it out. It's possible to send a message bigger than 1-2MB? If yes, where i have to put that property?

Thanks

Kafka 1.1 support

Currently the APIs are designed for 0.9.0. The current APIs should be tested against 1.1.0 and updated if needed

Use Swift 4 Codable protocols

Currently there is a lot of boilerplate code in the APIs types. With Swift 4's Codable protocols, we should create our own Encoder and Decoder for the Kafka protocol and let the compiler synthesise the rest for each type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.