rjrodger / seneca-kafka-transport

Seneca Kafka transport
MIT License
10 stars 6 forks source link

params undefined when starting client #1

Open cdromka opened 10 years ago

cdromka commented 10 years ago

hi,

I've tried the new version of the transport. server.js starts perfectly. But when trying to run the client.js I'm getting the following error. i am using server and client fomr /test/ folder of the kafka transport. and setConfig to initialize the topics in kafka.

C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1>node client.js 2014-04-29T21:03:41.810Z INFO hello Seneca/0.5.17/khkkeq 2014-04-29T21:03:42.619Z INFO plugin kafka-transport - ren96c client pubsub localhost 11300 Seneca/0.5.17/khkkeq

C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1\node_modules\seneca-kafka-transport\nodemodules\kafkaesque\lib\kafkaesque .js:48 return params.host + '' + params.port; ^ TypeError: Cannot read property 'host' of undefined at _makeBrokerKey (C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1\node_modules\seneca-kafka-transport\node_modules\ka fkaesque\lib\kafkaesque.js:48:18) at C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1\node_modules\seneca-kafka-transport\node_modules\kafkaesque\lib\kaf kaesque.js:121:23 at Object.callback (C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1\node_modules\seneca-kafka-transport\node_modules\k afkaesque\lib\kafkaesque.js:56:85) at Socket. (C:\Projects\Playground\EventBus\test1\EventBusTest1\EventBusTest1\node_modules\seneca-kafka-transport\node_module s\kafkaesque\lib\api.js:246:17) at Socket.EventEmitter.emit (events.js:95:17) at Socket. (_streamreadable.js:746:14) at Socket.EventEmitter.emit (events.js:92:17) at emitReadable (_stream_readable.js:408:10) at emitReadable (_stream_readable.js:404:5) at readableAddChunk (_stream_readable.js:165:9)

thanks, Roman

pelger commented 10 years ago

Hi, Can you confirm that the topics are created in kafka - you will need a 'request' and a 'response' each with 3 partitions. setConfig.js does not create the topics in Kafka, it just initializes a configuration block in zookeeper. Apologies for the confusion will update the documentation to make that clearer!

cdromka commented 10 years ago

Thank you for the reply! For this particular case I cannot confirm topics creation. Also there were problems in kafka itself when running it under windows.

On clean Linux installation I could run the tests successfully. (with 2 topics x 3 partitions each). in my setup I run 1 client and 3 servers each of them getting messages from own partition.

However after several restarts of server.js processes I started to get this error again. Looks like there is some problem in leader selection.

Now it is impossible to run the tests again without full cleanup of kafka and zookeeper logs.

Thanks, Roman

cdromka commented 10 years ago

Finally I found the problem. There are no more slots available. i.e. if I break service execution in debugger - slot remains occupied and does not let new connections. its in microbial and config.

what would be the best approach to free slots if service crashed?

Also I think it would be nice to display a friendly message that there are no more available slots.

pelger commented 10 years ago

Ah OK - thanks for getting back. Now I understand. There is a process on exit and SIGINT handler that would normally catch this and freeup the slot on normal or Ctrl-C process termination. However when using the debugger this will most likely not get called :) For testing / debugging there there is a script in the test folder called deregister.js. If you run this it will free up all slots in zookeeper.

Will update the docs to explain this. Really appreciate the feedback!

Bazm0 commented 10 years ago

Hi,

I have been experiencing the same issue; initially after starting client.js a few times, subsequently on multiple server.js restarts. I had configured 'request' & 'response' topics each with 3 partitions - tested operation with Kafka/ZK instances running locally (OSX Mavericks) and also on a clean debian Linux distro VM. Also tried using deregister.js to deallocate zk slots, but the same error is generated.

rjrodger commented 10 years ago

@cdromka @Bazm0 adding you as contribs @pelger any pointers for a fix?

Analect commented 9 years ago

@cdromka @Bazm0 Were you able to resolve this problem?

@pelger My set-up, as per eolas-tracer, isn't exactly as per seneca-kafka-transport, but I think it emulates it closely. I'm experiencing these problems described above too and microbial/kafkaesque/zookeeper interaction is really opaque. I tried running your suggested deregister.js script, changing the namespace from seneca to my own, but that doesn't appear to resolve.

Thanks for any input you can offer. Colum