Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> [Using offset to fetch message][Need Help]

Copy link to this message
Re: [Using offset to fetch message][Need Help]
In Kafka you cannot fetch just one message based on the offset, what you
get instead is to start fetching from the given offset. Of course you can
just get the first one that you want and then discard the rest and stop
fetching immediately, but I think a better idea would be cache the
not-acked-yet messages as Robert suggested.

On Mon, Jan 27, 2014 at 1:39 PM, Robert Turner <[EMAIL PROTECTED]> wrote:

> Rather than fetching the message again you could cache it in the spout and
> emit it again if the *fail* method is called and delete it when the
> *ack*method is called. This is possible as Storm guarantees to call
> the
> *fail* and *ack* methods with the *messageId* on the exact same spout that
> the message originated from. This means if you have cached the message
> there then it will still be available.
> On 27 January 2014 19:29, Abhishek Bhattacharjee <
> > I am using storm and kafka for replaying messages.
> > Now I want to save offset of each message and then use it later for
> > resending the message.
> > So my question is how can I fetch a single message using its offset ?
> > That is I know the offset of a message and I want to use the offset to
> > fetch that message(only that message).
> >
> >
> > Thanks,
> > *Abhishek Bhattacharjee*
> > *Pune Institute of Computer Technology*
> >
> --
> Cheers
>    Rob.

-- Guozhang