Re: [Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-07 Thread Jay Kreps
Hey Bhavesh, But isn't the problem here that you are trying to send messages after closing the producer? I think what I am saying is that since calling close is something the user initiates we don't need an api for this--you can keep track of this yourself, right? -Jay On Mon, Oct 6, 2014 at 11

Re: [Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-06 Thread Bhavesh Mistry
I agree with that statement that if producer is closed and try to send message it will give close. What we have done is wrap the NEW Producer API with Old Producer API. So when I use same code with OLD I do not get this issue. It is only problem with NEW Producer. Regardless of close, state I t

Re: [Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-06 Thread Jay Kreps
Hey Bhavesh, This is a sanity check. If you send a message after calling close on the producer you should get this error. It sounds like you have multiple threads sending, and you close the producer in the middle of this, then you get this error. This is expected. Perhaps I am misunderstanding?

Re: [Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-05 Thread Bhavesh Mistry
Hi Kafka Dev Team, *java.lang.* *IllegalStateException: Cannot send after the producer is closed.* The above seems to bug. If the ProducerRecord is in flight within send method is execute and another thread seems to shutdown in the middle of flight will get error. Thanks, Bhavesh On Sun, Oct

Re: [Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-05 Thread Bhavesh Mistry
Hi Kafka Dev Team, The use case is that we need to know producer state in background Threads and so we can submit the message. This seems to a bug in trunk code. I have notice that KafkaProducer itself does not have close state and inflight message will encounter following issues. Should I file

[Java New Producer Kafka Trunk ] Need a State Check API Method

2014-10-05 Thread Bhavesh Mistry
HI Kafka Dev, I would like to request state check state so I can manage the Life Cycle of Producer better. I you guys agree I will file Jira request. I just give state of producer can be I would like mange or start (create new instance of producer) or restart or close based on state. I just