About Storm's spout, bolt structure diagram.

Source: Internet
Author: User

About Storm's spout, bolt structure diagram
   The Green section is our most commonly used and relatively simple part. The red part is related to the transaction and will be explained in a later article.  basecomponent is the "lazy" class that storm provides. Why do you say that, it and its subclasses are more or less implementing some of the methods of their interface definitions. This allows us to inherit the class directly, rather than writing all the methods each time. It is worth mentioning, however, that the Basexxx class, which implements the method, is empty and returns null directly.

   usually (except for shell and transactional type), implement a spout, can directly implement interface Irichspout, if you do not want to write redundant code, you can directly inherit Baserichspout


usually, implement a bolt, you can implement the Irichbolt interface or inherit Baserichbolt, if you do not want to handle the result feedback, you can implement Ibasicbolt interface or inherit Basebasicbolt, It is actually equivalent to automatically doing the Prepare method and Collector.emit.ack (Inputtuple). Supplement--Richbolt vs Basicbolt

Directly with Basicbolt, the Tuple is automatically ack/fail after execute (), and Richbolt needs to call Ack/fail itself.

When do you use Richbolt? Bolt does not generate new messages at the time of each execute (), it needs to send new messages asynchronously (such as aggregating data for a period of time), or to asynchronously ack/fail the original message.

There is no collector parameter in Basicbolt's prepare () and only incoming collector per execute (). Richbolt, on the other hand, you can save the collector at initialization time and use it to send messages at any time.

In addition, if you use Richbolt's collector, also consider whether to send the message when the incoming tuple, if not, then the downstream processing node error will not go back to the spout resend. With Basicbolt, the default is taken.

About Storm's spout, bolt structure diagram.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.