You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Tavares Forby <tf...@qti.qualcomm.com> on 2020/01/07 19:46:20 UTC

callback function

Hi,

Is there a method in which a function can wake when something is new in the queue? This has to be non-blocking to the main thread.

Thanks,
-Tavares

RE: callback function

Posted by Tavares Forby <tf...@qti.qualcomm.com>.
Sorry, not queue.  I guess this is different than rabbitmq.  Kafka consumer pulls data from the broker.  There’s probably no event triggers to call a function.
[Kafka Architecture - Kafka Zookeeper Coordination Diagram]

From: Tom Bentley <tb...@redhat.com>
Sent: Wednesday, January 8, 2020 1:38 AM
To: Users <us...@kafka.apache.org>
Cc: Tavares Forby <tf...@qti.qualcomm.com>
Subject: [EXT] Re: callback function

Tavares, if you're asking about the consumer then I think you might have a misconception about how it works: The application calls poll() to fetch the latest records from the broker(s). The broker is not pushing records into some queue in the consumer. It might be worth reading https://kafka.apache.org/documentation/#design_pull.

Kind regards,

Tom

On Wed, Jan 8, 2020 at 9:09 AM Jonathan Santilli <jo...@gmail.com>> wrote:
Hello, when you say "something is new in the queue" you mean a new
message/record is available in a partition within a topic?

Cheers!

On Tue, Jan 7, 2020, 8:46 PM Tavares Forby <tf...@qti.qualcomm.com>> wrote:

> Hi,
>
> Is there a method in which a function can wake when something is new in
> the queue? This has to be non-blocking to the main thread.
>
> Thanks,
> -Tavares
>

Re: callback function

Posted by "M. Manna" <ma...@gmail.com>.
Hey Tavares,


On Wed, 8 Jan 2020 at 09:38, Tom Bentley <tb...@redhat.com> wrote:

> Tavares, if you're asking about the consumer then I think you might have a
> misconception about how it works: The application calls poll() to fetch the
> latest records from the broker(s). The broker is not pushing records into
> some queue in the consumer. It might be worth reading
> https://kafka.apache.org/documentation/#design_pull.
>
> Kind regards,
>
> Tom
>
> On Wed, Jan 8, 2020 at 9:09 AM Jonathan Santilli <
> jonathansantilli@gmail.com>
> wrote:
>
> > Hello, when you say "something is new in the queue" you mean a new
> > message/record is available in a partition within a topic?
> >
> > Cheers!
> >
> > On Tue, Jan 7, 2020, 8:46 PM Tavares Forby <tf...@qti.qualcomm.com>
> > wrote:
> >
> > > Hi,
> > >
> > > Is there a method in which a function can wake when something is new in
> > > the queue? This has to be non-blocking to the main thread.
> > >
> > > Thanks,
> > > -Tavares
> > >
> >


+1 to what Tom et. al. mentioned.

Perhaps it would be good to know what it is you are trying to solve
exactly. We may be able to help you better if we have then if picture :) ?

Regards,

>
>

Re: callback function

Posted by Tom Bentley <tb...@redhat.com>.
Tavares, if you're asking about the consumer then I think you might have a
misconception about how it works: The application calls poll() to fetch the
latest records from the broker(s). The broker is not pushing records into
some queue in the consumer. It might be worth reading
https://kafka.apache.org/documentation/#design_pull.

Kind regards,

Tom

On Wed, Jan 8, 2020 at 9:09 AM Jonathan Santilli <jo...@gmail.com>
wrote:

> Hello, when you say "something is new in the queue" you mean a new
> message/record is available in a partition within a topic?
>
> Cheers!
>
> On Tue, Jan 7, 2020, 8:46 PM Tavares Forby <tf...@qti.qualcomm.com>
> wrote:
>
> > Hi,
> >
> > Is there a method in which a function can wake when something is new in
> > the queue? This has to be non-blocking to the main thread.
> >
> > Thanks,
> > -Tavares
> >
>

Re: callback function

Posted by Jonathan Santilli <jo...@gmail.com>.
Hello, when you say "something is new in the queue" you mean a new
message/record is available in a partition within a topic?

Cheers!

On Tue, Jan 7, 2020, 8:46 PM Tavares Forby <tf...@qti.qualcomm.com> wrote:

> Hi,
>
> Is there a method in which a function can wake when something is new in
> the queue? This has to be non-blocking to the main thread.
>
> Thanks,
> -Tavares
>