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

@@ -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>