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|] 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 [ ] 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

configurer.addProperty("space-config.proxy-settings.connection-retries", "3");

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();
    int port = spaceProperty.getPort();
    if (port > 0) {


    String spaceURL = url.toString();

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

    if (StringUtils.hasText(groups)) {


    if (spaceProperty.isVersioned()) {

        configurer.addProperty("versioned", "true");


    *configurer.addProperty("space-config.proxy-settings.connection-retries", "3");*
    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( at org.openspaces.core.exception.DefaultExceptionTranslator@internalTranslate( at org.openspaces.core.exception.DefaultExceptionTranslator@translate( at org.openspaces.core.DefaultGigaSpace@write( at org.openspaces.core.DefaultGigaSpace@write( at$2@run( at java.lang.Thread@run(

2011-11-12 22:15:34,105 WARNING [net.jini.discovery.LookupLocatorDiscovery] - Exception occurred during unicast discovery to localhost:4164, retry in 240003ms. Please verify the unicast locators hostname and port are set properly.; Caused by: Connection refused 2011-11-12 22:15:38,828 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] No available members found - retrying [1/5] 2011-11-12 22:15:39,833 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] failed on no available member: localSpace_container1:localSpace - retrying [2/5] 2011-11-12 22:15:40,838 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] failed on no available member: localSpace_container1_1:localSpace - retrying [3/5] 2011-11-12 22:15:40,838 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] No available members found - retrying [4/5] 2011-11-12 22:15:41,843 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] failed on no available member: localSpace_container1:localSpace - retrying [5/5] 2011-11-12 22:15:42,848 INFO [com.gigaspaces.client] - Thread[Thread-58,5,main] failed on no available member: localSpace_container1_1:localSpace - stop retrying [5/5]

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

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|]{quote}

asked 2011-11-13 12:39:58 -0500

ramzi gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Meron
close date 2017-07-27 08:44:37.491573