Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 81714 invoked from network); 18 Oct 2007 20:41:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Oct 2007 20:41:15 -0000 Received: (qmail 12540 invoked by uid 500); 18 Oct 2007 20:41:03 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 12509 invoked by uid 500); 18 Oct 2007 20:41:02 -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 12500 invoked by uid 99); 18 Oct 2007 20:41:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 13:41:02 -0700 X-ASF-Spam-Status: No, hits=-98.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Oct 2007 20:41:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0362E714187 for ; Thu, 18 Oct 2007 13:40:24 -0700 (PDT) Message-ID: <28251552.1192740023982.JavaMail.jira@brutus> Date: Thu, 18 Oct 2007 13:40:23 -0700 (PDT) From: "vsevolod (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-1471) ActiveMQ via HTTP working strange In-Reply-To: <21798228.1192739783858.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] vsevolod updated AMQ-1471: -------------------------- Attachment: amq_http_client.py Python client attached. > ActiveMQ via HTTP working strange > --------------------------------- > > Key: AMQ-1471 > URL: https://issues.apache.org/activemq/browse/AMQ-1471 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 5.0.0 > Environment: Ubuntu/Debian, JDK 1.6 > Reporter: vsevolod > Priority: Minor > Attachments: amq_http_client.py > > > I'm not sure it is bug or I'm just dumb so sorry if I messed up. I tried 5.0 Snapshot with simple python client (included below) and it acts strange. And so localhost:8161/demo does. Getting first message is no problem but then AMQ returns HTTP status 204 (Not changed) and empty message body - until AMR restarted. What I'm doing wrong? > Output: > [test message2] -> http://localhost:8161/demo/message/queue23 > [test message3] -> http://localhost:8161/demo/message/queue23 > [test message4] -> http://localhost:8161/demo/message/queue23 > http://localhost:8161/demo/message/queue23?type=queue&timeout=100 -> > STATUS: 200 > test message2 > http://localhost:8161/demo/message/queue23?type=queue&timeout=100 -> > STATUS: 204 > http://localhost:8161/demo/message/queue23?type=queue&timeout=100 -> > STATUS: 204 > Program (very short): > ========== > #!/usr/bin/python > import httplib2 > import urllib > from time import * > BASE = "http://localhost:8161/demo/" > client = httplib2.Http(".cache") > dtype = "queue" > def SendMessage(queue, body): > url = BASE + "message/" + queue > print "[%s] -> %s" % (body, url) > body = urllib.urlencode({"type": dtype, "body" : body}) > return client.request(url, "POST", body, > headers={"Content-type": "application/x-www-form-urlencoded"}) > def GetMessage(queue, method): > url = BASE + "message/" + queue + "?" + urllib.urlencode({"type": dtype, "timeout": 100}) > print url,'->' > headers, body = client.request(url, method, None, None) > print 'STATUS:',headers["status"] > return body > queue = "queue23" > SendMessage(queue, "test message2") > SendMessage(queue, "test message3") > SendMessage(queue, "test message4") > sleep(1) > print GetMessage(queue, "GET") > print GetMessage(queue, "GET") > print GetMessage(queue, "GET") -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.