Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 47521 invoked from network); 9 Oct 2008 13:22:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Oct 2008 13:22:13 -0000 Received: (qmail 91666 invoked by uid 500); 9 Oct 2008 13:22:12 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 91644 invoked by uid 500); 9 Oct 2008 13:22:12 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 91633 invoked by uid 99); 9 Oct 2008 13:22:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2008 06:22:12 -0700 X-ASF-Spam-Status: No, hits=-1999.9 required=10.0 tests=ALL_TRUSTED,DNS_FROM_SECURITYSAGE X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2008 13:21:16 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A203F234C216 for ; Thu, 9 Oct 2008 06:21:52 -0700 (PDT) Message-ID: <1368810959.1223558512662.JavaMail.jira@brutus> Date: Thu, 9 Oct 2008 06:21:52 -0700 (PDT) From: "Dejan Bosanac (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQ-1453) Synchronous response from REST API In-Reply-To: <731039.1191937103925.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dejan Bosanac resolved AMQ-1453. -------------------------------- Assignee: Dejan Bosanac Resolution: Fixed I've implemented this using Camel instead of Lingo ... If you pass the sync parameter with the post, the servlet will wait for a response. Timeout is supported, but will be available when we upgrade to Camel 1.5 due to https://issues.apache.org/activemq/browse/CAMEL-906 > Synchronous response from REST API > ---------------------------------- > > Key: AMQ-1453 > URL: https://issues.apache.org/activemq/browse/AMQ-1453 > Project: ActiveMQ > Issue Type: New Feature > Reporter: Dejan Bosanac > Assignee: Dejan Bosanac > Fix For: 5.3.0 > > Attachments: activemq-web-lingo.patch > > > In some situations it could be very useful to use REST API in the "synchronous mode". > I've implemented this in the following manner: > If the "sync" header is set to the POST request the module will use Lingo project to perform request/response action with a given timeout. > The timeout value could be set through the "replyTimeout" servlet config parameter. A default value is 1000 (1s). > In case that response comes back in a specified time, the message will be returned as a response body. Timout exception will be ignored (maybe this could be configurable too?) so it will return OK status with empty response body (just as it is now) in case of timeout. > In case that "sync" header is not set the API behaves the same as now. > I've considered a few options for this implementation, but Lingo in the end seemed the best solution. It is not too heavy and it could be potentially used for other stuff in the future. One thing I would like to see improved in Lingo in the future is support for sending a message with persistency, priority and time to live parameters (new "request" method signature). Also, it depends on old version of amq which must be excluded in dependency declarations since it breaks the build. I could implement these improvments if you are interested. > I think this is quite a useful feature. I'm using it in a current project, but I would like if it could be included in a activemq-web module in the future. So, if anyone have any ides how some of these stuff could be implemented better or have some fresh ideas, please let me know. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.