Open gurujava454 opened 1 month ago
Can you please elaborate a bit about your issue. Could you share som example code? How many instances of a DirectoryPoller
are you running? Any chance you have two listeners registered in the same DirectoryPoller
instance?
try { directoryPoller = DirectoryPoller.newBuilder() .addPolledDirectory(directory) .addListener(new EventListener(this))//EventListener implements DirectoryListener .setPollingInterval(interval, TimeUnit.SECONDS) .setDefaultFileFilter(new RegexFileFilter(mask)) .start(); } catch (Exception e) { log.error(e); }
How many instances of a DirectoryPoller are you running?
In weblogic server, if we have 4 clusters , DirectoryPoller will run in all 4 clusters.
Any chance you have two listeners registered in the same DirectoryPoller instance?
yes
How do we know that how many listeners registered in the same DirectoryPoller instance?
How do we know that how many listeners registered in the same DirectoryPoller instance?
You register listeners like this:
.addListener(new EventListener(this))
...
DirectoryPoller will run in all 4 clusters.
Does this mean you have four DirectoryPoller
instances running (one for each cluster) or just one instance with four registered PolledDirectory
?
2 rectoryPoller instances running one for each cluster node and 2 listeners listening to one directory. So 2 calls had been called.
We are adding file poll listener while starting of the server. In multi cluster environment(ex clust1, clust2), Listener is getting added in two clusters. When a file is being added to directory/path, two listener(listeners from clust1 and clus2 ) are getting invoked and two times fileAdded method is calling. Please help me how to avoid this situation getting called two times.