just to understand,

 you have a producer in python sending messages to kafka ? if yes i think
each of the values "test", "val1", "val2" form a separate message and hence
would come in to storm as a separate tupple. If you want to send them as a
single value may be send in a array :

producer.send_messages(["test", "val1", "val2"])

and then you are trying to consume them in java in storm bolt? -- to
consume the above you can try to first explicitly cast the tuple object
using getValues, if array serialization is available by default, it will
work, if not i think you might have to implement a custom serializer for
array.

or rather just send in a json object and read it as a json.

hope that helps.





On Fri, May 22, 2015 at 9:21 PM, Sergio Fernández <[email protected]> wrote:

> Hi,
>
> I'm experimenting on feeding the KafkaSpout from another language
> different than Jaba, but I guess I have conceptual error...
>
> From Python I'm sending two values:
>
> producer.send_messages("test", "val1", "val2")
>
> But when from a Java bolt I try to handle it:
>
> execute(Tuple input) {
>   String val1 = input.getString(0);
>   String val2 = input.getString(1);
>   ...
> }
>
> I'm getting a IndexOutOfBoundsException: Index: 1, Size: 1.
>
> I'd appreciate any advise how to correctly send tuples.
>
> Thanks!
>
>
> --
> Sergio Fernández
> Partner Technology Manager
> Redlink GmbH
> m: +43 6602747925
> e: [email protected]
> w: http://redlink.co
>

Reply via email to