activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vezee <arun.addepa...@yahoo.com>
Subject Re: Configuring REST/HTTP
Date Wed, 02 Sep 2009 19:24:52 GMT

Having the same issue. Getting "No clientID header specified" in the browser.
 
Anyone any clue?

-vezee
---------------------------------

hb7 wrote:
> 
> I'm using activemq-4.1.0 (binary distribution) on a Debian/Linux AMD64.
> I'm
> running amq as a standalone server by calling:
> 
>     bin/activemq
> 
> with the standard configuration available in the binary download. All went
> quite right. It's possible to connect to the server via jconsole (JMX) and
> I'm
> able to run your example applications (the ruby examples via STOMP are
> really
> nice). But now I want to experiment with REST and there are some basic
> questions/problems:
> 
> My usage scenario: Using amq as a standalone message broker, connecting a
> bunch
> of php-clients (consumer) to a server application (ruby) over amq message
> queues. Therby I want to use the REST functionality of amq by
> communicationg to
> amq through a http or https connection.
> 
> How do I have to configure amq to be able to do REST processing ? I know
> from your documentation, that I have to configure and map the
> "MessageServlet".  But where in the "conf/activemq.xml" I have to place
> the mapping ? How does the mapping looks like ? And how can I consume a
> posted message i.e. from jconsole through a simple http client like curl
> ? Following my activemq.xml with which I tried to do the thing:
> 
> <beans>
>   <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>   <broker brokerName="localhost" useJmx="true"
> xmlns="http://activemq.org/config/1.0">
>     <!-- In ActiveMQ 4, you can setup destination policies -->
>     <destinationPolicy>
>       <policyMap><policyEntries>
>           <policyEntry topic="FOO.>">
>             <dispatchPolicy>
>               <strictOrderDispatchPolicy />
>             </dispatchPolicy>
>             <subscriptionRecoveryPolicy>
>               <lastImageSubscriptionRecoveryPolicy />
>             </subscriptionRecoveryPolicy>
>           </policyEntry>
>       </policyEntries></policyMap>
>     </destinationPolicy>
>     <persistenceAdapter>
>         <journaledJDBC journalLogFiles="5"
> dataDirectory="${activemq.base}/activemq-data"/>
>     </persistenceAdapter>
>     <transportConnectors>
>        <transportConnector name="openwire" uri="tcp://localhost:61616"
> discoveryUri="multicast://default"/>
>        <transportConnector name="ssl"     uri="ssl://localhost:61617"/>
>        <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
>        <transportConnector name="http"   uri="http://localhost:8080"/>
>     </transportConnectors>
>     <networkConnectors>
>       <networkConnector name="default-nc" uri="multicast://default"/>
>     </networkConnectors>
>   </broker>
>   <servlet>
>       <servlet-name>MessageServlet</servlet-name>
>      
> <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
>       <load-on-startup>1</load-on-startup>
>   </servlet>
>   <servlet-mapping>
>       <servlet-name>MessageServlet</servlet-name>
>       <url-pattern>/queue</url-pattern>
>   </servlet-mapping>
> </beans>
> 
> 
> Starting the amq (bin/activemq) amq shows all configured transport
> connectors
> comming up correctly. After that I'm running jconsole and connect to the
> running amq. There I add a message queue named "web" via the "Broker
> Operations"
> "addQueue" command and produce a new textmessage on the newly created
> "web"
> queue using its "sendTextMessage" command to queue the string "hello". All
> this
> went quite well (I checked the message being there via the "browse"
> command of 
> the "web" queue). Now I tried to consume the message via curl:
> 
>    curl http://localhost:8080/queue/web  
> 
> and get following response:
> 
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 400 </title>
> </head>
> <body><h2>HTTP ERROR: 400</h2><pre>No clientID header specified</pre>
> <p>RequestURI=/queue/web</p><p><small> http://jetty.mortbay.org/

> Powered by Jetty:// </small></p><br/>
> </body>
> </html>
> 
> Additionally the amd logs: "WARN  HttpTunnelServlet    - No clientID
> header specified"
> 
> After that I controlled the status of my "web" queue, but nothing happens.
> All
> attribute values keep its state (i.e.  EnqueueCount 1 DequeueCount 0).
> Second
> try I called curl like this:
> 
>    curl -H "clientID: id67"  http://localhost:8080/queue/web
> 
> to submit a "clientID". After that curl gives no output at all but amd
> logs following:
> 
>    WARN  HttpTunnelServlet  - The clientID header specified is invalid.
> Client 
>                               sesion has not yet been established for it:
> id67
> 
> 
> How do I receive a valid clientID or how can I initiate a client session
> respectivily ?
> 
> At that time I give up because there are too many possibilities in being
> wrong.
> I hope you can tell me what's going wrong.
> 
> Regards
> hb7
> 
> 
> PS: I'm using activemq for the first time and I'm not very familiar with
> all
> that xml configuration stuff in the java world. Using ruby and or
> ruby/rails
> make configuration tons lighter. But nevertheless your message passing
> system
> is quite well and so I do really want to use it in my projects.  
> 
> 

-- 
View this message in context: http://www.nabble.com/Configuring-REST-HTTP-tp8311839p25264088.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message