-Re: [Using offset to fetch message][Need Help]
Guozhang Wang 2014-01-27, 22:15
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
> *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 <
> [EMAIL PROTECTED]> wrote:
> > 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*