You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samza.apache.org by Jordi Blasi Uribarri <jb...@nextel.es> on 2015/08/03 13:31:56 UTC
Dinamically asigning output topic
Hi,
Is there a way to assign dynamically in the job code the topic where the output messages should be sent to? I am testing an idea that needs to decide programmatically (and not in from limited range) the destination topic. As I am understanding it, I need to declare the output format in the job properties file, so I need to know the topic name. Is there a way to free from this dependency?
Thanks.
Jordi
________________________________
Jordi Blasi Uribarri
Área I+D+i
jblasi@nextel.es
Oficina Bilbao
[http://www.nextel.es/wp-content/uploads/Firma_Nextel_2015.png]
Re: Dinamically asigning output topic
Posted by Karthik Sriram <am...@gmail.com>.
I believe you only need to declare the system stream you are writing to
before hand . ie your Kafka broker list if you are using Kafka. If auto
create topics is enabled, you can dynamically write to any topic within a
predefined system stream. I'd suggest simply use a hash map of topic to
OutputStream object and dynamically create new output stream objects as and
when you need a new topic or else use a pre existing one.
Input topics though are predefined but you could use a regex.
On Aug 3, 2015 4:32 AM, "Jordi Blasi Uribarri" <jb...@nextel.es> wrote:
> Hi,
>
> Is there a way to assign dynamically in the job code the topic where the
> output messages should be sent to? I am testing an idea that needs to
> decide programmatically (and not in from limited range) the destination
> topic. As I am understanding it, I need to declare the output format in the
> job properties file, so I need to know the topic name. Is there a way to
> free from this dependency?
>
> Thanks.
>
> Jordi
> ________________________________
> Jordi Blasi Uribarri
> Área I+D+i
>
> jblasi@nextel.es
> Oficina Bilbao
>
> [http://www.nextel.es/wp-content/uploads/Firma_Nextel_2015.png]
>