0

I am new to Storm and Trident. I wrote a spout (used Storm core) to read from RDBMS. I override the open() method of BaseRichSpout

public void open(Map map, TopologyContext topologyContext, SpoutOutputCollector spoutOutputCollector) {
    this.collector = spoutOutputCollector;
    this.context = topologyContext;
    // connect to DB
    connection = RDBMSConnection.getConnection();
    query = "SELECT * from CUSTOMER";

}

Now I wanted to use Trident to do the same since it has built in join function. Could anyone please let me know, how can we achieve the same functionality in Trident. I am planning to implement IOpaquePartitionedTridentSpout. Also is there any tutorial to learn more about Trident.

Matthias J. Sax
  • 59,682
  • 7
  • 117
  • 137
Alok
  • 1,374
  • 3
  • 18
  • 44
  • you may check trident mongodb as a reference for your work from here: https://github.com/eldenbishop/trident-mongodb – Shams Feb 21 '15 at 21:36

1 Answers1

0

I would suggest not to reinvent the wheel for such a common task and see if one of the existing solutions works for you. For example: https://github.com/apache/storm/tree/master/external/storm-jdbc

You could always use it as a reference for your own implementation.

aljipa
  • 716
  • 4
  • 6