How to initialize Tranquilizer with custom message type

Hi, all,

I want to send real time data to druid using Tranquilizer.

From the Git, https://github.com/druid-io/tranquility/blob/master/core/src/test/java/com/metamx/tranquility/example/JavaExample.java, I can create a sender with message type of Map<String, Object>.

While my message type is String. So, how should I initialize the sender using java code?

Sender with message type of Map<String, Object>, the initialize code is :

final InputStream configStream = JavaExample.class.getClassLoader().getResourceAsStream(“foo_data_source.json”);

final TranquilityConfig config = TranquilityConfig.read(configStream);

final DataSourceConfig wikipediaConfig = config.getDataSource(“foo”);

final Tranquilizer<Map<String, Object>> sender = DruidBeams.fromConfig(wikipediaConfig)

  .buildTranquilizer(wikipediaConfig.tranquilizerBuilder());

From the source code, I can see that the DruidBeams.fromConfig(config) function while create default message type with Map<String, Object>. So, how should I initialize the sender with String message type?

I also see that DruidBeams.fromConfig(config,tag: TypeTag[MessageType]) function****seems to initialize a builder with custom message type. I an newer to Scala, I have tried many times to initialize TypeTag, while I don’t succeed :frowning:

BTW, my data is in TSV format, so should I initialize the sender with String message type or List message type?

Thanks.

Yufeng Wang

Is the problem solved?
And I also have this problem

在 2016年10月14日星期五 UTC+8下午3:42:09,yufeng.w…@gmail.com写道: