You can initialize it using normal singleton patterns in the bolt's prepare method. On Dec 6, 2014 1:05 PM, "Maxime Nay" <[email protected]> wrote:
> Hi, > > I have a bolt that's doing http request to some external web service. This > web service can be really slow (response time in 3 to 10 secs). > Hence, this bolt requires a rather large parallelism hint. (somewhere > around 800). I'm using 2 workers. > > Right now, I'm instantiating the HttpClient in the prepare method of the > bolts and end up with 400 httpclients per worker. For obvious reasons, I > would like to only use one HttpClient per worker. > Any idea on how I could do that? > > Thanks! > > Maxime >
