diff --git a/README.md b/README.md index 30da8fb..3f53a9f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is an implementation of Tron eventsubscribe model. * **kafkaplugin** module is the implementation for kafka, it implements IPluginEventListener, it receives events subscribed from Java-tron and relay events to kafka server. * **mongodbplugin** mongodbplugin module is the implementation for mongodb. ### Setup/Build - +Eventplugin can be built with JDK 8 or JDK17. 1. Clone the repo 2. Go to eventplugin `cd eventplugin` 3. run `./gradlew build` @@ -20,7 +20,11 @@ This is an implementation of Tron eventsubscribe model. event.subscribe = { path = "" // absolute path of plugin server = "" // target server address to receive event triggers - dbconfig = "" // dbname|username|password, if you want to create indexes for collections when the collections are not exist, you can add version and set it to 2, as dbname|username|password|version + # dbname|username|password, if you want to create indexes for collections when the collections + # are not exist, you can add version and set it to 2, as dbname|username|password|version + # if you use version 2 and one collection not exists, it will create index automaticaly; + # if you use version 2 and one collection exists, it will not create index, you must create index manually; + dbconfig = "" topics = [ { triggerName = "block" // block trigger, the value can't be modified diff --git a/build.gradle b/build.gradle index edf5ae0..c26b5fb 100644 --- a/build.gradle +++ b/build.gradle @@ -8,13 +8,13 @@ subprojects { dependencies { compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.5' - compileOnly 'org.projectlombok:lombok:1.18.12' + compileOnly 'org.projectlombok:lombok:1.18.34' compileOnly group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}" compileOnly group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.13' - annotationProcessor 'org.projectlombok:lombok:1.18.12' + annotationProcessor 'org.projectlombok:lombok:1.18.34' annotationProcessor group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}" - testCompileOnly 'org.projectlombok:lombok:1.18.12' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.12' + testCompileOnly 'org.projectlombok:lombok:1.18.34' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.34' testAnnotationProcessor group: 'org.pf4j', name: 'pf4j', version: "${pf4jVersion}" compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' compileOnly group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.25' diff --git a/plugins/mongodbplugin/src/main/java/org/tron/mongodb/util/Pager.java b/plugins/mongodbplugin/src/main/java/org/tron/mongodb/util/Pager.java index c2172b1..5ef28df 100644 --- a/plugins/mongodbplugin/src/main/java/org/tron/mongodb/util/Pager.java +++ b/plugins/mongodbplugin/src/main/java/org/tron/mongodb/util/Pager.java @@ -38,8 +38,8 @@ public static void handle(HashMap hs, int currentPage, int page int start = (currentPage - 1) * pageSize; int offset = pageSize; - hs.put("start", new Integer(start)); - hs.put("offset", new Integer(offset)); + hs.put("start", start); + hs.put("offset", offset); } public Pager() {