Atmosphere / atmosphere

Event Driven WebSockets Framework with Cross-Browser Fallbacks
http://async-io.org/
3.69k stars 749 forks source link

TimeOut exception long polling #1941

Closed farhatakrout closed 9 years ago

farhatakrout commented 9 years ago

Salut,

I am currently developing a project with atmosphere. I developed two heavy customers waync-2.0.0 and server usingManagedService annotations, theReady,Disconnect andmessage. I used the following dependencies for developments of clients and server:

<dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-runtime</artifactId>
        <version>2.3.0-RC6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-servlet_3.0_spec</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.4.1</version>
    </dependency>

    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>wasync</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.atmosphere</groupId>
        <artifactId>nettosphere</artifactId>
        <scope>compile</scope>
        <version>1.4.1</version>
    </dependency>
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty</artifactId>
        <version>3.10.1.Final</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.1.3</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.1.3</version>
    </dependency>

The code of client side is :

    AtmosphereClient client = ClientFactory.getDefault().newClient(AtmosphereClient.class);

    RequestBuilder request = client.newRequestBuilder()
            .method(Request.METHOD.GET)
            .uri("http://ecul0613:10210/rntpos/rntposAtmosphere/2086955287/gnius")
            .trackMessageLength(true)
            .encoder(new Encoder<RntPosAtmosphereMessage, String>() {
                @Override
                public String encode(RntPosAtmosphereMessage data) {
                    try {
                        return mapper.writeValueAsString(data);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
            })
            .decoder(new Decoder<String, RntPosProtocol>() {
                @Override
                public RntPosProtocol decode(Event type, String data) {

                    data = data.trim();

                    // Padding
                    if (data.length() == 0) {
                        return null;
                    }

                    if (type.equals(Event.MESSAGE)) {
                        try {
                            return mapper.readValue(data, RntPosProtocol.class);
                        } catch (IOException e) {
                            logger.debug("Invalid message {}", data);
                            return null;
                        }
                    } else {
                        return null;
                    }
                }
            })
            .transport(Request.TRANSPORT.LONG_POLLING);

    final Socket socket = client.create()

I had a problem TimeoutException after a client connection minute on the server. The trace of the exception is:

java.util.concurrent.TimeoutException: Request timed out to ecul0613 / 10.30.193.95: 10210 of 60000 ms at com.ning.http.client.providers.netty.request.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:47) [Async-http-client-1.9.5.jar: na] at com.ning.http.client.providers.netty.request.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:48) [Async-http-client-1.9.5.jar: na] Has org.jboss.netty.util.HashedWheelTimer $ HashedWheelTimeout.expire (HashedWheelTimer.java:556) [netty-3.10.1.Final.jar: na] Has org.jboss.netty.util.HashedWheelTimer $ HashedWheelBucket.expireTimeouts (HashedWheelTimer.java:632) [netty-3.10.1.Final.jar: na] Has org.jboss.netty.util.HashedWheelTimer $ Worker.run (HashedWheelTimer.java:369) [netty-3.10.1.Final.jar: na] Has org.jboss.netty.util.ThreadRenamingRunnable.run (ThreadRenamingRunnable.java:108) [netty-3.10.1.Final.jar: na].

Do you have any idea about this problem please.

Thank you.

jfarcand commented 9 years ago

Please use the mailing list for question https://groups.google.com/group/atmosphere-framework?pli=1