Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
5.0.0
-
None
-
None
-
Ubuntu/Debian, JDK 1.6
Description
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(
)
return client.request(url, "POST", body,
headers=
)
def GetMessage(queue, method):
url = BASE + "message/" + queue + "?" + urllib.urlencode(
)
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")