jprante / elasticsearch-jdbc

JDBC importer for Elasticsearch
Apache License 2.0
2.84k stars 709 forks source link

Comma no longer works in schedule (cron syntax) #299

Open MichaelXt opened 10 years ago

MichaelXt commented 10 years ago

Comma no longer works in schedule (cron syntax).

java.lang.IllegalArgumentException: invalid cron expression format: Unexpected end of expression at org.xbib.cron.CronExpression.buildExpression(CronExpression.java:287) at org.xbib.cron.CronExpression.(CronExpression.java:101) at org.xbib.elasticsearch.plugin.feeder.AbstractFeeder.schedule(AbstractFeeder.java:177) at org.xbib.elasticsearch.plugin.river.jdbc.JDBCRiver.start(JDBCRiver.java:94) at org.elasticsearch.river.RiversService.createRiver(RiversService.java:148)

jprante commented 10 years ago

Can you show the cron expression you use?

MichaelXt commented 10 years ago

Sure: "0 5,35 * * * ?" gives the error, but the "0 35 * * * ?" works fine

jprante commented 10 years ago

I have added a "comma test" in JDBC river 1.3.0.1 with your expression, it works fine.

iamgururaj commented 10 years ago

I had the same issue. As a workaround I had used an array of cron expression as the schedule params support this. Example: "schedule": ["0 0 3 ? * *","0 0 7 ? * *","0 0 11 ? * *"]

jprante commented 10 years ago

Is the comma issue on Windows?

iamgururaj commented 10 years ago

@jprante no. Its occuring in linux as well. sorry for the delayed response

loganbhardy commented 9 years ago

Just confirming that I'm seeing the same issue with the latest elasticsearch-river-jdbc-1.4.0.8

"schedule": "0 1,16,31,46 * * * ? ", throws the error "schedule": "0 1/15 * * * ? ", works fine