EventReceiverFirehose : StringInputRowParser cannot be cast to io.druid.data.input.impl.MapInputRow

I try to use EventReceiverFirehose, after facing obstacle in using RabbitMQ - https://groups.google.com/forum/#!topic/druid-user/yJV0GgAH8yY

My ioconfig looks as follow

“ioConfig” : {
“type” : “realtime”,
“firehose”: {
“type”: “receiver”,
“serviceName”: “eventReceiverServiceName”,
“bufferSize”: 10000
},
“plumber”: {
“type”: “realtime”
}
},

``

However, I get error

2016-03-11T10:47:15,947 INFO [chief-wikipedia[0]] com.metamx.emitter.core.LoggingEmitter - Event [{“feed”:“alerts”,“timestamp”:“2016-03-11T10:47:15.941Z”,“service”:“realtime”,“host”:“ip-172-30-1-252.ap-southeast-1.compute.internal:8084”,“severity”:“component-failure”,“description”:“RuntimeException aborted realtime processing[wikipedia]”,“data”:{“class”:“io.druid.segment.realtime.RealtimeManager”,“exceptionType”:“java.lang.ClassCastException”,“exceptionMessage”:“io.druid.data.input.impl.StringInputRowParser cannot be cast to io.druid.data.input.impl.MapInputRowParser”,“exceptionStackTrace”:“java.lang.ClassCastException: io.druid.data.input.impl.StringInputRowParser cannot be cast to io.druid.data.input.impl.MapInputRowParser\n\tat io.druid.segment.realtime.firehose.EventReceiverFirehoseFactory.connect(EventReceiverFirehoseFactory.java:64)\n\tat io.druid.segment.realtime.FireDepartment.connect(FireDepartment.java:104)\n\tat io.druid.segment.realtime.RealtimeManager$FireChief.initFirehose(RealtimeManager.java:197)\n\tat io.druid.segment.realtime.RealtimeManager$FireChief.run(RealtimeManager.java:263)\n”}}]
Exception in thread “chief-wikipedia[0]” java.lang.ClassCastException: io.druid.data.input.impl.StringInputRowParser cannot be cast to io.druid.data.input.impl.MapInputRowParser
at io.druid.segment.realtime.firehose.EventReceiverFirehoseFactory.connect(EventReceiverFirehoseFactory.java:64)
at io.druid.segment.realtime.FireDepartment.connect(FireDepartment.java:104)
at io.druid.segment.realtime.RealtimeManager$FireChief.initFirehose(RealtimeManager.java:197)
at io.druid.segment.realtime.RealtimeManager$FireChief.run(RealtimeManager.java:263)

``

Any idea how can I resolve this?

p/s

I came across https://groups.google.com/forum/#!searchin/druid-user/io.druid.data.input.impl.StringInputRowParser$20cannot$20be$20cast$20to$20io.druid.data.input.impl.MapInputRowParser/druid-user/7XhTrO1r3_k/UV8-dTm6ovYJ The suggestion is to use tranquility. I had tried to setup tranquility. It is extremely difficult to setup everything and run https://github.com/druid-io/tranquility/blob/master/core/src/test/java/com/metamx/tranquility/example/JavaExample.java properly. I have to download quite a number jar files manually, compile metamx’s java-util-java-util-0.27.9.zip manually…

At the end, I still get
Exception in thread “main” java.lang.NoClassDefFoundError: com/metamx/common/scala/net/curator/DiscoConfig
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)

``

Hey Yan,

You should be able to get that to work with a parser of “type”: “map”.

BUT I would still recommend using tranquility! The easiest way to use it is to download the distribution: https://github.com/druid-io/tranquility#downloadable-distribution and set up Tranquility Server. This gives you an HTTP API that you can POST to.

You can also embed it in your own program using Maven to download the dependencies. If you do this then you don’t have to download any jars manually. Maven will do it for you. See here: https://github.com/druid-io/tranquility#getting-tranquility-with-maven

Thank you for your reply. I assume the “map” you mention, is changing from

"dataSchema" : {
  "dataSource" : "wikipedia",
  "parser" : {
    "type" : "string",

to

"dataSchema" : {
  "dataSource" : "wikipedia",
  "parser" : {
    "type" : "map",

Is there any documentation which describes on this? So far, I had look through http://druid.io/docs/latest/ingestion/index.html , but don’t find any useful info for “map”

I’m going to follow your recommendation, to try one more time on Tranquility server.

So far, I saw Druid provides various ways to inject real-time data into it.

  1. Tranquility
  2. EventReceiverFirehose
  3. RabbitMQ - https://groups.google.com/forum/#!topic/druid-user/yJV0GgAH8yY (Do you have idea how can we remove message from RabbitMQ queue after Druid had read it?)

which is a recommendation way, if insertion speed is our concern?

Thanks.
Cheok

Tranquility is recommendation

See: druid.io/docs/0.9.0-rc1/tutorials/quickstart.html

All new tutorials focus on using Tranquility.

Thanks Fangjin. We had switched our focus on Imply, which is easier to use.