Giter Club home page Giter Club logo

Comments (3)

vrogach2020 avatar vrogach2020 commented on July 28, 2024 1

After discussion with customer we cleared up the problem.
It's required to check that tarantool connections are available on service start.
The proposed solution is to use synchronous call to client.getVersion() on startup.

from cartridge-springdata.

wey1and avatar wey1and commented on July 28, 2024

Hi, @andrei-punko!
I tried to reproduce the problem, but it didn't work. I tried to specify not correct address in the settings and turn it off on the fly. And in the first case, it immediately throws an exception, in the second i received java.util.concurrent.TimeoutException: Failed to receive a response to request 5 within 5000 ms - it timed out.
Can you give more information about the configuration and what is happened on the Tarantool side in Lua code?

from cartridge-springdata.

andrei-punko avatar andrei-punko commented on July 28, 2024

Our configuration on java side:

@Configuration("tarantoolConfiguration")
public class TarantoolConfig extends AbstractTarantoolDataConfiguration {
    @Value("${tarantool.address}")
    private String address;

    @Value("${tarantool.username}")
    private String username;

    @Value("${tarantool.password}")
    private String password;

    @Override
    protected TarantoolServerAddress tarantoolServerAddress() {
        return new TarantoolServerAddress(address);
    }

    @Override
    public TarantoolCredentials tarantoolCredentials() {
        return new SimpleTarantoolCredentials(username, password);
    }

    @Override
    public TarantoolClient<TarantoolTuple, TarantoolResult<TarantoolTuple>> tarantoolClient(
            TarantoolClientConfig tarantoolClientConfig,
            TarantoolClusterAddressProvider tarantoolClusterAddressProvider
    ) {
        ProxyTarantoolTupleClient proxyClient =
                new ProxyTarantoolTupleClient(super.tarantoolClient(tarantoolClientConfig, tarantoolClusterAddressProvider));
        return new RetryingTarantoolTupleClient(proxyClient, requestRetryPolicyFactory());
    }

    @Bean
    public RequestRetryPolicyFactory requestRetryPolicyFactory() {
        return TarantoolRequestRetryPolicies
                .byNumberOfAttempts(0)
                .build();
    }
}

Not important what happened on Tarantool side when wrong url used

from cartridge-springdata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.