Rename custom transport factory
This commit is contained in:
parent
097862b30a
commit
26bfc28746
4 changed files with 25 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
|||
package de.rpr.testcontainers.infinispan;
|
||||
|
||||
import de.rpr.testcontainers.infinispan.transport.NoTopologyStateTransferTransportFactory;
|
||||
import de.rpr.testcontainers.infinispan.transport.DisabledTopologyStateTransferTransportFactory;
|
||||
import org.infinispan.client.hotrod.impl.transport.TransportFactory;
|
||||
import org.testcontainers.containers.BindMode;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class ClusteredInfinispanContainer extends InfinispanContainer {
|
|||
*/
|
||||
@Override
|
||||
protected Optional<Class<? extends TransportFactory>> getTransportFactory() {
|
||||
return Optional.of(NoTopologyStateTransferTransportFactory.class);
|
||||
return Optional.of(DisabledTopologyStateTransferTransportFactory.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package de.rpr.testcontainers.infinispan.transport;
|
||||
|
||||
import org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* This is a subclass of the {@link TcpTransportFactory}. It overwrites the {@link TcpTransportFactory#updateServers(Collection, byte[], boolean)}
|
||||
* in order to suppress the update of the cluster nodes, communicated back to the client during the Hotrod Topology State Transfer.
|
||||
*/
|
||||
public class DisabledTopologyStateTransferTransportFactory extends TcpTransportFactory {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DisabledTopologyStateTransferTransportFactory.class);
|
||||
|
||||
@Override
|
||||
public void updateServers(final Collection<SocketAddress> newServers, final byte[] cacheName, final boolean quiet) {
|
||||
LOG.info("Receiving new Servers: {}. Ignoring...", newServers);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package de.rpr.testcontainers.infinispan.transport;
|
||||
|
||||
import org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Collection;
|
||||
|
||||
public class NoTopologyStateTransferTransportFactory extends TcpTransportFactory {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(NoTopologyStateTransferTransportFactory.class);
|
||||
|
||||
@Override
|
||||
public void updateServers(final Collection<SocketAddress> newServers, final byte[] cacheName, final boolean quiet) {
|
||||
LOG.info("Receiving new Servers: {}. Ignoring...", newServers);
|
||||
}
|
||||
}
|
|
@ -169,9 +169,7 @@
|
|||
</subsystem>
|
||||
<subsystem xmlns="urn:infinispan:server:endpoint:9.0">
|
||||
<hotrod-connector socket-binding="hotrod" cache-container="clustered">
|
||||
|
||||
<topology-state-transfer lazy-retrieval="false" lock-timeout="1000" replication-timeout="5000"/>
|
||||
|
||||
</hotrod-connector>
|
||||
<rest-connector socket-binding="rest" cache-container="clustered">
|
||||
<authentication security-realm="ApplicationRealm" auth-method="BASIC"/>
|
||||
|
|
Loading…
Reference in a new issue