I found the concept of rivers interesting, so I decided to implement
my own out of curiosity. The goal is to index JSON documents returned
from an HTML 5 WebSocket. My issue is very likely a naming issue, I
am formatting my code around the existing river plugins.
Please forgive me, but the code is in Scala. It still should be very
readable (if not more so ) https://gist.github.com/837883
My es-plugin.properties
plugin=plugin.SimpleWebsocketRiverPlugin
class SimpleWebsocketRiverPlugin @Inject() extends AbstractPlugin {
def name() = {
"river-simplewebsocket";
}
def description() = {
"River Simple Websocket Plugin";
}
}
class SimpleWebsocketRiverModule extends AbstractModule {
override def configure() = {
bind(classOf[River]).to(classOf[SimpleWebsocketRiver]).asEagerSingleton()
}
}
The actual River declaration is:
class SimpleWebsocketRiver @Inject()(riverName: RiverName,
riverSettings: RiverSettings, client: Client) extends
AbstractRiverComponent(riverName, riverSettings) with River
I am able to bundle the code as a zip file and install as a plugin:
./bin/plugin url file:/// install simplewebsocket
ElasticSearch starts off fine:
...
[2011-02-21 18:03:04,210][INFO ][plugins ] [Gideon,
Gregory] loaded [river-simplewebsocket]
...
Attempting to create a new river results in an error:
curl -XPUT localhost:9200/_river/test_river/_meta -d '
{
"type" : "simplewebsocket"
}
'
ERROR:
[2011-02-21 18:05:51,509][WARN ][river ] [Gideon,
Gregory] failed to create river [simplewebsocket][test_river]
org.elasticsearch.common.settings.NoClassSettingsException: Failed to
load class with value [simplewebsocket]
I am assuming that I simply did not name something correctly. What am
I missing?
Thanks in advance,
Ivan