[ 
https://issues.apache.org/jira/browse/AMQ-4756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13877762#comment-13877762
 ] 

Timothy Bish commented on AMQ-4756:
-----------------------------------

I think this just comes down to a documentation issue.  The servlet uses the 
type option to determine topic vs queue the content after the /messages/ domain 
is considered to be the complete destination name with slashes converted to '.' 
to conform the the JMS naming spec and allow for sending to hierarchical 
destination names like virtual topics and the like.  

> / in queue name converted to . when using REST API to create messages on 
> queues
> -------------------------------------------------------------------------------
>
>                 Key: AMQ-4756
>                 URL: https://issues.apache.org/jira/browse/AMQ-4756
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.8.0
>         Environment: jdk 1.6
> 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
>            Reporter: eebbesen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: NEEDS_REVIEWED
>
>
> My 5.0.8 ActiveMQ queue is named queue/andburn. Using
> {noformat}
> curl -u admin:admin -d 'body="Aardvark"' 
> "http://localhost:8161/api/message/queue/andburn?type=queue";
> {noformat}
> or 
> {noformat}
> curl -u admin:admin -d 'body="Aardvark"' 
> 'http://localhost:8161/api/message/queue/andburn?type=queue'
> {noformat}
> 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 {{/}} or {{%2F}} to represent 
> slashes.
> Note: all escaping was done after queue in the URI, e.g.
> {noformat}
> "http://localhost:8161/api/message/queue\/andburn?type=queue";
> {noformat}
> [The ActiveMQ REST|http://activemq.apache.org/rest.html] page was not helpful 
> in addressing this.
> This is also happening when sending requests to ActiveMQ via a Ruby script 
> using the RestClient gem.
> {noformat}
> require 'rest_client'
> require 'rubygems'
> @user = 'admin'
> @pass = 'admin'
> @host = 'localhost'
> @port = '8161'
> @queue = "queue/andburn"
> @post_ws = "/api/message/#{@queue}?type=queue"
> payload = "some_topic"
> url = "http://#{@user}:#{@pass}@#{@host}:#{@port}#{@post_ws}";
> response = RestClient.post(url, 'body' => payload)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to