# proxy connection disconnects override configuration spaces [closed]

GigaSpaces group,

I have two question around client behavior when it cannot find the space cluster (system upgrade, network failure, ...). I am using GigaSpaces 7.1 version.

h2. Question#1 Client Proxy settings

The document listed in [proxy connectivity|http://www.gigaspaces.com/wiki/display/XAP71/Proxy+Connectivity] mentions that proxy-settings +should be specified as part of the space configuration (server side)+ I changed the pu.xml deployed in my local server and that worked beautifully and changed the retry count from 10 to 5. However the document also refers to [ http://www.gigaspaces.com/wiki/displa... ] which lists an example to override default configuration using the URLSpaceConfigurer

h4.The example

+UrlSpaceConfigurer spaceConfigurer = new UrlSpaceConfigurer("/./space").addProperty("space-config.serialization-type", "1");+

So I went ahead and kept the retries at the server to 5 and changed the code (the client) that connection to use 3. SpaceProperties is my object the comes from reading my own config, but as you see I am doing

h4. Code Example

public GigaSpace buildSpace(SpaceProperties spaceProperties) {

    assert spaceProperties != null;

try {
UrlSpaceConfigurer urlSpaceConfigurer = getUrlSpaceConfigurer(spaceProperties);
GigaSpaceConfigurer gsConfigurer = new GigaSpaceConfigurer(urlSpaceConfigurer);
return gsConfigurer.gigaSpace();

}
catch (CannotFindSpaceException e) {
throw new GigaSpaceProviderException(StringUtils.append("SpaceFailure url=", spaceProperties), e);
}

}

private UrlSpaceConfigurer getUrlSpaceConfigurer(SpaceProperties spaceProperty) {

StringBuilder url = new StringBuilder();
url.append(spaceProperty.getProtocol()).//
append("://").//
append(spaceProperty.getHost());
int port = spaceProperty.getPort();
if (port > 0) {
url.append(":").append(port);
}

url.append("/").//
append(spaceProperty.getContainerName()).//
append("/").//
append(spaceProperty.getSpaceName());

String spaceURL = url.toString();

UrlSpaceConfigurer configurer = new UrlSpaceConfigurer(spaceURL);
configurer.noWriteLease(spaceProperty.isNoWriteLease());
configurer.addProperty("useLocalCache", spaceProperty.isUseLocalCache() ? "true" : "false");
String groups = spaceProperty.getGroups();

if (StringUtils.hasText(groups)) {
configurer.lookupGroups(groups);

}

if (spaceProperty.isVersioned()) {

}

return configurer;

}


h4. Result My code (I hope straightforward) is building a connection to GigaSpaces via the url configurer and GigaSpaceConfigurer, and I am trying to override space-config.proxy-settings.connection-retries using the addProperty, but with my unit test when I shutdown gigaspaces (the server) I still get

22:15:23 I am thread: Thread-57 could not write to space, exception: org.openspaces.core.RemoteDataAccessException ; at org.openspaces.core.exception.DefaultExceptionTranslator@internalTranslate(DefaultExceptionTranslator.java:108):: at org.openspaces.core.exception.DefaultExceptionTranslator@internalTranslate(DefaultExceptionTranslator.java:103):: at org.openspaces.core.exception.DefaultExceptionTranslator@translate(DefaultExceptionTranslator.java:50):: at org.openspaces.core.DefaultGigaSpace@write(DefaultGigaSpace.java:629):: at org.openspaces.core.DefaultGigaSpace@write(DefaultGigaSpace.java:621):: at gallup.space.SpaceDisconnectionTest\$2@run(SpaceDisconnectionTest.java:55):: at java.lang.Thread@run(Thread.java:662)::

I can attach my unit test code but it really is creating multiple threads and they are all trying to connect to the space.

The question here Did I assume wrong is this property 100% need to be setup at the server only, no way a client can override?

h2. Question#2

Two important configurations that deals with gigaspace disconnects are

+cluster-config.groups.group.fail-over-policy.fail-over-find-timeout+ and +space-config.proxy-settings.connection-retries+

And it is working as it designed so when I ask for an operation (write, read,...) I fail only after I exhausted all retries, so Total Time is around #retries X timeout. However The actual singleton GigaSpace instance I use in my application never gets in an invalid state. Meaning I let my junit run for hours (same JVM) and I came back turn the local cluster back on and everything worked (read, writes, ....) Is that normal behavior

Thank you for your time and patience, +Ramzi+