I have an arrayList that I want to emit and receive it in another bolt. So as suggested on another post here I used: the first bolt:

collector.emit(new Values(listI));

the next bolt:

public void execute(Tuple tuple) {
ArrayList<Integer> i = (ArrayList<Integer>)tuple.getValue(0);

but instead of a size 4 list, I am getting a list with size 0. Any thoughts?

Recommended Answers

All 3 Replies

OK. Firstly there's a translation problem. "bolt" has no relevant meaning in English.
Secondly, you post two pieces of code that have absolutely no connection or variables in common. You need to post a lot more of your code, so we can see how these two pieces relate to each other.

It's a storm project I forgot to mention it...

OK, that explains it!
We still need to see more code. How/where is listI defined and initialised? Did you confirm its contents immediately before the emit? It seems unlikely that the serialisation has managed to transmit the type correctly while losing its values.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.