SGF-378 - SDG completely ignores the 'socket-read-timeout' attribute on the Gateway element nested in a GatewayHub.

This commit is contained in:
John Blum
2015-02-24 15:00:32 -08:00
parent d42d5b57fe
commit eade5d8a39
6 changed files with 10 additions and 12 deletions

View File

@@ -115,7 +115,7 @@ public class GatewayHubFactoryBean extends AbstractWANComponentFactoryBean<Gatew
gateway.setOrderPolicy(gatewayProxy.getOrderPolicy());
gateway.setSocketBufferSize(gatewayProxy.getSocketBufferSize());
//gateway.setSocketReadTimeout(gatewayProxy.getSocketReadTimeout());
gateway.setSocketReadTimeout(gatewayProxy.getSocketReadTimeout());
if (gatewayProxy.getQueue() != null) {
GatewayQueue queue = gatewayProxy.getQueue();

View File

@@ -38,7 +38,7 @@ public class GatewayProxy {
private Integer concurrencyLevel = Gateway.DEFAULT_CONCURRENCY_LEVEL;
private Integer socketBufferSize = Gateway.DEFAULT_SOCKET_BUFFER_SIZE;
//private Integer socketReadTimeout = Gateway.DEFAULT_SOCKET_READ_TIMEOUT;
private Integer socketReadTimeout = Gateway.DEFAULT_SOCKET_READ_TIMEOUT;
private List<GatewayEndpoint> endpoints;
private List<GatewayEventListener> listeners;
@@ -101,7 +101,6 @@ public class GatewayProxy {
return (socketBufferSize != null ? socketBufferSize : Gateway.DEFAULT_SOCKET_BUFFER_SIZE);
}
/*
public void setSocketReadTimeout(final Integer socketReadTimeout) {
this.socketReadTimeout = socketReadTimeout;
}
@@ -109,7 +108,6 @@ public class GatewayProxy {
public Integer getSocketReadTimeout() {
return (socketReadTimeout != null ? socketReadTimeout : Gateway.DEFAULT_SOCKET_READ_TIMEOUT);
}
*/
public static class GatewayEndpoint {

View File

@@ -2997,8 +2997,7 @@ Deprecated as of Gemfire 7
]]></xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="gateway" type="gatewayType" minOccurs="0"
maxOccurs="unbounded">
<xsd:element name="gateway" type="gatewayType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation><![CDATA[
Deprecated as of Gemfire 7

View File

@@ -100,7 +100,7 @@ public class GatewayHubNamespaceTest {
assertEquals(8, gatewayOne.getConcurrencyLevel());
assertEquals(Gateway.OrderPolicy.THREAD, gatewayOne.getOrderPolicy());
assertEquals(65536, gatewayOne.getSocketBufferSize());
//assertEquals(120, gatewayOne.getSocketReadTimeout());
assertEquals(15000, gatewayOne.getSocketReadTimeout());
assertNotNull(gatewayOne.getListeners());
assertFalse(gatewayOne.getListeners().isEmpty());
assertEquals(1, gatewayOne.getListeners().size());

View File

@@ -206,7 +206,7 @@ public class GatewayHubFactoryBeanTest {
gatewayProxy.setOrderPolicy(Gateway.OrderPolicy.THREAD);
gatewayProxy.setQueue(gatewayQueue);
gatewayProxy.setSocketBufferSize(16384);
//gatewayProxy.setSocketReadTimeout(300);
gatewayProxy.setSocketReadTimeout(300);
GatewayHub mockGatewayHub = mock(GatewayHub.class, "testDoInit.MockGatewayHub");
@@ -248,7 +248,7 @@ public class GatewayHubFactoryBeanTest {
verify(mockGateway, times(1)).addListener(same(mockGatewayListener));
verify(mockGateway, times(1)).setOrderPolicy(eq(gatewayProxy.getOrderPolicy()));
verify(mockGateway, times(1)).setSocketBufferSize(eq(gatewayProxy.getSocketBufferSize()));
//verify(mockGateway, times(1)).setSocketReadTimeout(eq(gatewayProxy.getSocketReadTimeout()));
verify(mockGateway, times(1)).setSocketReadTimeout(eq(gatewayProxy.getSocketReadTimeout()));
verify(mockGateway, times(1)).getQueueAttributes();
verify(mockGatewayQueueAttributes, times(1)).setAlertThreshold(eq(gatewayQueue.getAlertThreshold()));
verify(mockGatewayQueueAttributes, times(1)).setBatchConflation(eq(gatewayQueue.getEnableBatchConflation()));
@@ -282,7 +282,7 @@ public class GatewayHubFactoryBeanTest {
gatewayProxy.setOrderPolicy(Gateway.OrderPolicy.THREAD);
gatewayProxy.setQueue(gatewayQueue);
gatewayProxy.setSocketBufferSize(4096);
//gatewayProxy.setSocketReadTimeout(60);
gatewayProxy.setSocketReadTimeout(60);
GatewayHub mockGatewayHub = mock(GatewayHub.class, "testGatewayQueueWithOverflowNoPersistence.MockGatewayHub");
@@ -312,7 +312,7 @@ public class GatewayHubFactoryBeanTest {
verify(mockGatewayHub, times(1)).addGateway(eq(gatewayProxy.getId()), eq(gatewayProxy.getConcurrencyLevel()));
verify(mockGateway, times(1)).setOrderPolicy(eq(gatewayProxy.getOrderPolicy()));
verify(mockGateway, times(1)).setSocketBufferSize(eq(gatewayProxy.getSocketBufferSize()));
//verify(mockGateway, times(1)).setSocketReadTimeout(eq(gatewayProxy.getSocketReadTimeout()));
verify(mockGateway, times(1)).setSocketReadTimeout(eq(gatewayProxy.getSocketReadTimeout()));
verify(mockGatewayQueueAttributes, times(1)).setAlertThreshold(gatewayQueue.getAlertThreshold());
verify(mockGatewayQueueAttributes, times(1)).setBatchConflation(gatewayQueue.getEnableBatchConflation());
verify(mockGatewayQueueAttributes, times(1)).setBatchSize(gatewayQueue.getBatchSize());

View File

@@ -25,7 +25,8 @@
<gfe:gateway-hub id="testGatewayHub" bind-address="localhost" manual-start="true" max-time-between-pings="5000"
port="45123" socket-buffer-size="16384" startup-policy="primary">
<gfe:gateway gateway-id="gateway1" concurrency-level="8" order-policy="thread" socket-buffer-size="65536">
<gfe:gateway gateway-id="gateway1" concurrency-level="8" order-policy="thread" socket-buffer-size="65536"
socket-read-timeout="15000">
<gfe:gateway-listener>
<bean class="org.springframework.data.gemfire.config.GatewayHubNamespaceTest.TestGatewayListener"/>
</gfe:gateway-listener>