You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metron.apache.org by Nick Allen <ni...@nickallen.org> on 2017/02/07 19:24:21 UTC

BulkMessageWriterBolt and MessageGetters

I am trying to use the `BulkMessageWriterBolt` to write a specific tuple
field named "measurement" to a Kafka topic.

    -   id: "kafkaBolt"
        className: "org.apache.metron.writer.bolt.BulkMessageWriterBolt"
        constructorArgs:
            - "${kafka.zk}"
        configMethods:
            -   name: "withMessageWriter"
                args:
                    - ref: "kafkaWriter"
            -   name: "withMessageGetter"
                args:
                    - "measurement"

Rather than wanting the name of a field, it wants the name of a valid
`MessageGetters` enum; either RAW or NAMED.  It seems like there is no way
for me to plugin a `NamedMessageGetter` with a custom field name like
"measurement".

Am I missing something?  Is there a way to do this out-of-the-box?

Re: BulkMessageWriterBolt and MessageGetters

Posted by Ryan Merriman <me...@gmail.com>.
You are correct, the BulkMessageWriterBolt/MessageGetters combination is
not flexible enough.  You would have to modify BulkMessageWriterBolt.  I
have addressed this in METRON-695 which will be submitted as a PR shortly.
It will be easy to do what you want after that is merged in.

Ryan

On Tue, Feb 7, 2017 at 1:24 PM, Nick Allen <ni...@nickallen.org> wrote:

> I am trying to use the `BulkMessageWriterBolt` to write a specific tuple
> field named "measurement" to a Kafka topic.
>
>     -   id: "kafkaBolt"
>         className: "org.apache.metron.writer.bolt.BulkMessageWriterBolt"
>         constructorArgs:
>             - "${kafka.zk}"
>         configMethods:
>             -   name: "withMessageWriter"
>                 args:
>                     - ref: "kafkaWriter"
>             -   name: "withMessageGetter"
>                 args:
>                     - "measurement"
>
> Rather than wanting the name of a field, it wants the name of a valid
> `MessageGetters` enum; either RAW or NAMED.  It seems like there is no way
> for me to plugin a `NamedMessageGetter` with a custom field name like
> "measurement".
>
> Am I missing something?  Is there a way to do this out-of-the-box?
>