i am using infispan in distributed mode which works fine, the only problem is, it prints a lot of logs and messes up the log files. below is a common line that gets printed.
WARN [jgroups-6,batch-pdcr-app-6c8fcd799c-fhmf8-35894] UDP: JGRP000012: discarded message from different cluster recon-infinispan (our cluster is ISPN). Sender was 021f21a7-4434-0509-f6bb-b3451f0c98d5 (received 33 identical messages from 021f21a7-4434-0509-f6bb-b3451f0c98d5 in the last 60012 ms)
how do i disable this logging?
below is the cache configuration.
@Bean
@Primary
public EmbeddedCacheManager cacheManager() {
return new DefaultCacheManager(getGlobalConfiguration());
}
private GlobalConfiguration getGlobalConfiguration() {
GlobalConfigurationBuilder globalConfigurationBuilder = new GlobalConfigurationBuilder();
globalConfigurationBuilder.transport().defaultTransport().initialClusterSize(1);
return globalConfigurationBuilder.build();
}
@Bean
public Cache<String, String> interfaceCache(DefaultCacheManager cacheManager) {
return this.buildCache(ProducerConstants.BATCH_PRODUCER_INTERFACE_CACHE, cacheManager, interfaceCacheExpiringEvictingConfig(cacheManager));
}
private Configuration interfaceCacheExpiringEvictingConfig(DefaultCacheManager cacheManager) {
ConfigurationBuilder confBuilder = new ConfigurationBuilder();
confBuilder.expiration().lifespan(24, TimeUnit.HOURS);
confBuilder.memory().maxCount(100).whenFull(EvictionStrategy.REMOVE);
confBuilder.clustering().cacheMode(CacheMode.DIST_SYNC);
return confBuilder.build();
}
private <K, V> Cache<K, V> buildCache(String cacheName, DefaultCacheManager cacheManager, Configuration configuration) {
cacheManager.defineConfiguration(cacheName, configuration);
Cache<K, V> cache = cacheManager.getCache(cacheName);
cache.addListener(new CacheListener());
return cache;
}
You have 2 clusters using the same ports and the traffic conflicts with each other. I would recommend using different ports in one of the clusters. The properties jgroups.bind.port
and jgroups.mcast_port
can be used to configure the JGroups ports.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.