storm-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jungtaek Lim <>
Subject Re: Dynamic streamId in declareOutputFields for Bolts
Date Tue, 30 Jan 2018 08:34:57 GMT
Stream is declared when topology is composed, and prepare is called when
task is being launched in executor, so defining stream always occurs
earlier. If you would want to declare stream ID dynamically, it should be
resolved in submitting topology, and downstream components should know
about that to connect to such stream.

Jungtaek Lim (HeartSaVioR)

2018년 1월 30일 (화) 오후 5:17, Rajeev <>님이 작성:

> Hi,
> I am currently using a bolt to emit data to one of the below 2 streams:
> declarer.declareStream( "ABC", new Fields( "message" ) );
> declarer.declareStream( "XYZ", new Fields( "message" ) );
> But now I need to create this StreamId dynamically. I was trying to use
> variables initialised in prepare method. But i see that
> the declareOutputFields method is called first and does not have the data
> initialised in prepare method.
> Is there any other way to use a dynamic name for the stream ?
> Regards,
> Rajeev.

View raw message