@@ -30,6 +30,8 @@ public class MongodbSenderImpl{
30
30
private String contractEventTopic = "" ;
31
31
private String contractLogTopic = "" ;
32
32
33
+ private String revokingItems = "" ;
34
+
33
35
private Thread triggerProcessThread ;
34
36
private boolean isRunTriggerProcessThread = true ;
35
37
@@ -133,6 +135,9 @@ private void createCollections(){
133
135
134
136
mongoManager .createCollection (contractEventTopic );
135
137
createMongoTemplate (contractEventTopic );
138
+
139
+ mongoManager .createCollection (revokingItems );
140
+ createMongoTemplate (revokingItems );
136
141
}
137
142
138
143
private void loadMongoConfig (){
@@ -277,13 +282,19 @@ public void handleContractEventTrigger(Object data) {
277
282
@ Override
278
283
public void run () {
279
284
String dataStr = (String )data ;
285
+ // Block revoking events:
280
286
if (dataStr .contains ("\" removed\" :true" )) {
281
287
try {
282
288
JSONObject jsStr = JSONObject .parseObject (dataStr );
283
289
String uniqueId = jsStr .getString ("uniqueId" );
284
290
if (uniqueId != null ) {
285
291
template .delete ("uniqueId" , uniqueId );
286
292
}
293
+
294
+ MongoTemplate revokingTemplate = mongoTemplateMap .get (revokingItems );
295
+ if (Objects .nonNull (revokingTemplate )){
296
+ revokingTemplate .addEntity (dataStr );
297
+ }
287
298
} catch (Exception ex ) {
288
299
log .error ("unknown exception happened in parse object " , ex );
289
300
}
0 commit comments