Hi,
I am new to Apache Storm. I have a spout which emits the data to bolt.
Form the bolt I need to acknowledge the data.
Please find the sample code below.
Spout code:
@Override
public void nextTuple() {
Status tweet = queue.poll();
if (tweet != null) {
logger.info("Emitting out " + tweet);
collector.emit(new Values(tweet));
}
}
@Override
public void ack(Object msgId) {
// msgId should be "ID 6"
System.out.println("[HelloWorldSpout] ack on msgId" + msgId);
}
@Override
public void fail(Object msgId){
System.out.println("[HelloWorldSpout] fail on msgId" + msgId);
}
Bolt code:
@Override
public void execute(Tuple input) {
Tuple test = null;
System.out.println("input-->"+input);
_collector.ack(test);
}
Question:
1. How to acknowledge the spout from bolt?
2. If failure happens, whether the spout will automatically emit the data
once again, are we have to emit manually once again? If so please let me know
how to do it.
3. How to verify the fail acknowledgement from bolt?
Regards,
N.S.Bharathi
________________________________
Happiest Minds Disclaimer
This message is for the sole use of the intended recipient(s) and may contain
confidential, proprietary or legally privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not the
original intended recipient of the message, please contact the sender by reply
email and destroy all copies of the original message.
Happiest Minds Technologies <http://www.happiestminds.com>
________________________________