Skip to content
This repository has been archived by the owner on Jan 1, 2019. It is now read-only.

Time out error #80

Open
harjitdotsingh opened this issue Feb 16, 2018 · 2 comments
Open

Time out error #80

harjitdotsingh opened this issue Feb 16, 2018 · 2 comments

Comments

@harjitdotsingh
Copy link

Hi there,

I have this code

 ParallelTask pt = parallelClient.prepareHttpGet("/search/query?q=$QUERY")
                .setHttpHeaders(new ParallecHeader().addPair("x-user", env.getProperty("ifi.user")).addPair("x-password", env.getProperty("ifi.password"))).setProtocol(RequestProtocol.HTTPS)
                .setHttpPort(443)
                .async()
                .setReplaceVarMapToSingleTargetSingleVar("QUERY", queryList, "cdws21.ificlaims.com")
                .setResponseContext(returnMap)
                .execute((res, responseContext) -> {
                    String resourcePath = res.getRequest().getResourcePath();
                    String keyword = resourcePath.substring(resourcePath.lastIndexOf('=') + 1);
                    returnMap.put(keyword, res.getResponseContent());

                });


        while (!pt.isCompleted()) {

            try {
                Thread.sleep(500L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }

I see that sometimes we get this error

see this in our parallel request sender [1]__RESP_RECV_IN_MGR 1 (+0) / 1 (100.00%) AFT 14.125 S @ API_0 @ 2018.02.16.15.47.51.239-0500 , TaskID : ded015e3-cae , CODE: NA, RESP_BRIEF: EMPTY , ERR: java.util.concurrent.TimeoutException: No response received after 14000

How can we be notified of the completion of the results. Right now this loop is tight and I don't like it. Is there any way to use Futures and or PRomises ?

@jeffpeiyt
Copy link
Contributor

will check today

@jeffpeiyt
Copy link
Contributor

@harjitdotsingh sorry for the late reply.

for the timeout, you can follow http://www.parallec.io/docs/configurations/#timeout . you can change that in the async http client or to update ParallecGlobalConfig.ningFastClientRequestTimeoutMillis = 15000; before start.

you may put the notifying logic in the onComplete function.

if you want to poll the futures, you can take a look at http://www.parallec.io/javadoc/io/parallec/core/ParallelTask.html#getParallelTaskResult-- and poll for http://www.parallec.io/javadoc/io/parallec/core/actor/message/NodeReqResponse.html#singleTaskResponse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants