2

My 5.0.8 ActiveMQ queue is named queue/andburn. Using

curl -u admin:admin -d 'body="Aardvark"' "http://localhost:8161/api/message/queue/andburn?type=queue"

creates a new queue queue.andburn. When I escape / like \/ I get queue\.andburn. When I omit type=queue I don't see my message added to my existing queue. Same when I use / to represent slashes.

Note: all escaping was done after queue in the URI, e.g.

"http://localhost:8161/api/message/queue\/andburn?type=queue"

The ActiveMQ REST page was not helpful in addressing this.

Here is the output of curl --version

curl 7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz

Update: This is also happening when sending requests to ActiveMQ via a Ruby script using the RestClient gem.

eebbesen
  • 5,070
  • 8
  • 48
  • 70
  • Created ActiveMQ issue [AMQ-4756](https://issues.apache.org/jira/browse/AMQ-4756) – eebbesen Sep 30 '13 at 18:51
  • [AMQ-4756](https://issues.apache.org/jira/browse/AMQ-4756) appears to have been fixed now -- thanks ActiveMQ community! – eebbesen Nov 15 '13 at 00:51

2 Answers2

0

Escaping URLs is typically done by percent encoding. So in your case a slash would be %2F

http://localhost:8161/api/message/queue%2Fandburn?type=queue

I have not tested this with CURL and ActiveMQ, but it's the most natural way to represent a slash in a URI.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84
  • This also results in a queue named `queue.andburn`. It is as if the URI is decoded, then all of thw `/`s are converted to `.`s. – eebbesen Sep 30 '13 at 15:15
0

I came across this issue today and did a minor search. I use ActiveMQ version 5.15.11. The solution that worked for me can be found here. I simply used the alternate producing syntax. Simply, http://127.0.0.1:8161/api/message?type=queue&destination=My.Queue.With/Slash (instead of giving the queue name after ../message.queue/{queue_name})

ampofila
  • 655
  • 2
  • 13
  • 28