Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 70EC5200C1B for ; Tue, 14 Feb 2017 20:11:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6F745160B5F; Tue, 14 Feb 2017 19:11:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9398D160B45 for ; Tue, 14 Feb 2017 20:11:07 +0100 (CET) Received: (qmail 87822 invoked by uid 500); 14 Feb 2017 19:11:06 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 87805 invoked by uid 99); 14 Feb 2017 19:11:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 19:11:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BD475188004 for ; Tue, 14 Feb 2017 19:11:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.48 X-Spam-Level: X-Spam-Status: No, score=0.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id zVhrFC36JFId for ; Tue, 14 Feb 2017 19:11:03 +0000 (UTC) Received: from mail-qt0-f175.google.com (mail-qt0-f175.google.com [209.85.216.175]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 6EB475FB5A for ; Tue, 14 Feb 2017 19:11:03 +0000 (UTC) Received: by mail-qt0-f175.google.com with SMTP id k15so119793136qtg.3 for ; Tue, 14 Feb 2017 11:11:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=9+AzsBIuI49LTCyaKAy1iJoayt+VLahQq4VN4jEWre8=; b=mjqReidcnWNsqsW2OaRFGFdZTXP/Fxh+pO/RABW9qpbDP6+QfAgsv+wxNLpcLKXaIb SMnQ/MgE+eqDJnZMjmWeFZDn2y7LEpVY8U8DqlfEPspi3ykcR8kqJQdsKKzj18xj+XDc LpPUhF580p0sMO0917y5nZvV8cXDE9csusNXOKSTtcxCICVUn4Lfn8rDMElsz6jn4iev bxdND3dFAvDutor6kSh63ELg7rLLv/uChB8V6pAotEshShU7tfLQ2cdHB9FZOOkYT/Xz CAAEBPdl/Eqt5tgHgDEu36ycKSOWFsQ03nrm2LDX8ekB/AZpjKhhGUafGPo2YNhrZde+ CpgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=9+AzsBIuI49LTCyaKAy1iJoayt+VLahQq4VN4jEWre8=; b=rU19SUFYArdsuJueN88zskx4/W/10OjRqr3qcbrj49ohc0OWXHcmkdrR1OpDKCFnur 1287Cztb/jIQiIC+uZtQTEzaweaqelO22cqGTYuW1PSv8erL+PplMVZqeQ7kV+nijylS duteJiaIObBOeWdnCpdFyGM4rtZ/xLznY2mEyRezjQW9BaWhNdQA2XiWOdYg/8E6sF3R 33eGhn80+Bzp3h9W0RAK2I//m6eJgjWJWYn6XZG2TcjMaHqQL/U3pD4RmZZt3C+lEnH+ CTh1Uo3RT07y9QCtQrK6yghCaeB85kSyipvLY3xJ3edO3JyKid9vFKf2XdfCNIIercXQ S1nw== X-Gm-Message-State: AMke39mZjzdu765ImmrdhwwJuZzJriivVT8PbEhnf/BT3AaUO44BdtlG03ufisdMIUFFlOajqh0czu346xKtwQ== X-Received: by 10.237.37.71 with SMTP id w7mr27611448qtc.287.1487099462604; Tue, 14 Feb 2017 11:11:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.54.81 with HTTP; Tue, 14 Feb 2017 11:11:02 -0800 (PST) In-Reply-To: References: From: Robbie Gemmell Date: Tue, 14 Feb 2017 19:11:02 +0000 Message-ID: Subject: Re: WebSocket timeout To: "users@qpid.apache.org" Content-Type: text/plain; charset=UTF-8 archived-at: Tue, 14 Feb 2017 19:11:08 -0000 On 14 February 2017 at 18:07, Benjamin Busjaeger wrote: > Thanks for the replies! > >> I expect you are seeing the connection close after 300 seconds of > inactivity > That's right > >> I've raised https://issues.apache.org/jira/browse/QPID-7670 to cover this > issue > Thank you > >> to workaround this issue in v6.1 of the broker all you need to do is get > the *broker* to request the *client* to send "heartbeat" messages > Thanks, that workaround unblocks me. > >> you'd also have to remove the "&amqp.idleTimeout=3600000" > If I remove the that parameter, the simple client program times out after > 90 seconds: > > javax.jms.JMSException: Transport closed due to the peer exceeding our > requested idle-timeout > [...] > Caused by: java.io.IOException: Transport closed due to the peer exceeding > our requested idle-timeout > > If I set the idleTimeout to 100 seconds (in addition to the broker > heartBeatDelay=60 parameter), the client completes successfully. Is that > expected behavior? > The client defaults to having a 60sec timeout so if the broker isnt sending it heartbeats or other data regularly enough it will time out. To disable the client requesting heartbeats and enforcing the server idle period, try setting its config to 0 instead of removing it. >> We plan to include this in Qpid Broker for Java 6.1.2. > Thank you > > On Mon, Feb 13, 2017 at 3:23 AM Keith W wrote: > >> We plan to include this in Qpid Broker for Java 6.1.2. >> >> On 13 February 2017 at 11:04, Rob Godfrey wrote: >> > As a colleague (thanks Robbie!) also pointed out to me, to workaround >> this >> > issue in v6.1 of the broker all you need to do is get the *broker* to >> > request the *client* to send "heartbeat" messages more frequently than >> the >> > Jetty timeout. You can do this by adding your config.json to add a >> setting >> > for "connection.heartBeatDelay", setting it to 60 seconds for example: >> > >> > After such a change, my config.json start like this: >> > >> > { >> > "id" : "91fedfad-7c78-4b1e-b78c-70be39433bea", >> > "name" : "${broker.name}", >> > "modelVersion" : "6.1", >> > "connection.heartBeatDelay" : 60, >> > "authenticationproviders" : [ { >> > >> > ... >> > >> > >> > Since the broker for 6.1 doesn't respect client requested heartbeating >> > (until we fix that bug), you'd also have to remove the >> > "&amqp.idleTimeout=3600000" from you client connection URL... however >> > hopefully this is enough to get you going for the moment. >> > >> > Apologies you ran into this defect - we'll try to release a new version >> > including the fix as soon as possible. >> > >> > Hope this helps, >> > Rob >> > >> > On 13 February 2017 at 11:15, Rob Godfrey >> wrote: >> >> >> >> I've raised https://issues.apache.org/jira/browse/QPID-7670 to cover >> this >> >> issue, and made a change on trunk which I believe will provide the >> expected >> >> behaviour wrt AMQP idle timeouts. >> >> >> >> -- Rob >> >> >> >> On 13 February 2017 at 00:04, Keith W wrote: >> >>> >> >>> Hi Benjamin, >> >>> >> >>> This is a defect in the Qpid Broker for Java. After running your >> >>> code, I expect you are seeing the connection close after 300 seconds >> >>> of inactivity. This will be Jetty's >> >>> org.eclipse.jetty.websocket.WebSocketFactory#maxIdleTime default, >> >>> which is forcing the idle connection to close. The Broker currently >> >>> provides no way to override this value. To workaround you'd need to >> >>> find a way to keep the wire busy from the application (perhaps sending >> >>> an empty message, with a TTL, to a 'heartbeat' queue). >> >>> >> >>> The Broker ought to be respecting the peer's requested idle timeout >> >>> for websocket connections and ensuring that Jetty's maxIdleTime does >> >>> not interfere. This currently is not implemented. >> >>> >> >>> >> >>> >> http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transport-v1.0-os.html#doc-doc-idle-time-out >> >>> >> >>> Please raise a JIRA https://issues.apache.org/jira/browse/QPID. There >> >>> is a defect fix release due on 6.1 soon, so it may be possible to >> >>> include this too. Patches are always appreciated too. >> >>> >> >>> Kind regards, Keith. >> >>> >> >>> >> >>> On 11 February 2017 at 16:37, Benjamin Busjaeger >> >>> wrote: >> >>> > Is there a way to keep JMS WebSocket connections open (e.g., enable >> >>> > ping/pong heartbeats)? >> >>> > >> >>> > I get the following error: >> >>> > >> >>> > javax.jms.JMSException: Transport connection remotely closed. >> >>> > >> >>> > at org.apache.qpid.jms.exceptions.JmsExceptionSupport.create( >> >>> > JmsExceptionSupport.java:86) >> >>> > >> >>> > at org.apache.qpid.jms.exceptions.JmsExceptionSupport.create( >> >>> > JmsExceptionSupport.java:108) >> >>> > >> >>> > at org.apache.qpid.jms.JmsConnection.onAsyncException( >> >>> > JmsConnection.java:1385) >> >>> > >> >>> > at org.apache.qpid.jms.JmsConnection.onProviderException( >> >>> > JmsConnection.java:1369) >> >>> > >> >>> > at org.apache.qpid.jms.JmsConnection.onConnectionFailure( >> >>> > JmsConnection.java:1237) >> >>> > >> >>> > at >> >>> > org.apache.qpid.jms.provider.amqp.AmqpProvider.fireProviderException( >> >>> > AmqpProvider.java:1015) >> >>> > >> >>> > at org.apache.qpid.jms.provider.amqp.AmqpProvider$20.run( >> >>> > AmqpProvider.java:830) >> >>> > >> >>> > at >> >>> > >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) >> >>> > >> >>> > at java.util.concurrent.FutureTask.run(FutureTask.java:266) >> >>> > >> >>> > at >> >>> > >> >>> > >> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201( >> >>> > ScheduledThreadPoolExecutor.java:180) >> >>> > >> >>> > at >> >>> > >> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run( >> >>> > ScheduledThreadPoolExecutor.java:293) >> >>> > >> >>> > at java.util.concurrent.ThreadPoolExecutor.runWorker( >> >>> > ThreadPoolExecutor.java:1142) >> >>> > >> >>> > at java.util.concurrent.ThreadPoolExecutor$Worker.run( >> >>> > ThreadPoolExecutor.java:617) >> >>> > >> >>> > at java.lang.Thread.run(Thread.java:745) >> >>> > >> >>> > Caused by: java.io.IOException: Transport connection remotely closed. >> >>> > >> >>> > ... 8 more >> >>> > >> >>> > With a relatively simple client program: >> >>> > >> >>> > Context context = new InitialContext(); >> >>> > >> >>> > >> >>> > ConnectionFactory factory = (ConnectionFactory) >> >>> > context.lookup( >> >>> > "myFactoryLookup"); >> >>> > >> >>> > Destination queue = (Destination) >> >>> > context.lookup("myQueueLookup" >> >>> > ); >> >>> > >> >>> > >> >>> > Connection connection = factory.createConnection("admin", >> >>> > "admin"); >> >>> > >> >>> > connection.setExceptionListener(new >> MyExceptionListener()); >> >>> > >> >>> > // connection.start(); >> >>> > >> >>> > >> >>> > Session session = connection.createSession(false, >> Session. >> >>> > AUTO_ACKNOWLEDGE); >> >>> > >> >>> > session.createProducer(queue); >> >>> > >> >>> > Thread.sleep(360000); >> >>> > >> >>> > jndi properties: >> >>> > >> >>> > java.naming.factory.initial = >> >>> > org.apache.qpid.jms.jndi.JmsInitialContextFactory >> >>> > >> >>> > connectionfactory.myFactoryLookup = amqpws://localhost >> >>> > :5000?amqp.vhost=default&amqp.idleTimeout=3600000 >> >>> > >> >>> > queue.myQueueLookup = Q1 >> >>> > >> >>> > Server version: qpid - 6.1.1 build: 1775107 (AMQP version(s) >> >>> > [major.minor]: >> >>> > 0-8, 0-9, 0-9-1, 0-10, 1.0) >> >>> > Client version: qpid-jms-client-0.20.0 with proton-j-0.16.0 >> >>> > >> >>> > Thanks, >> >>> > Ben >> >>> >> >>> --------------------------------------------------------------------- >> >>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org >> >>> For additional commands, e-mail: users-help@qpid.apache.org >> >>> >> >> >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org >> For additional commands, e-mail: users-help@qpid.apache.org >> >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org