activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblwizard <david.lo...@pgi.com>
Subject Re: PHP, REST and ActiveMQ
Date Tue, 18 May 2010 14:35:57 GMT

Dejan,

I've tried that and seems that I get no response and nothing shows in the
queue.  One of my co-workers looked into the stomp piece but could not seem
to get everything he needed to compile for the Stomp and ActiveMQ.  That was
why I was trying to get the REST piece to work.

I've looked at the demo and its a simple html page that submits the values
to a what I'm guessing is a java applet called message/FOO/BAR ... so I
can't really see any of the REST functionality.

I'm sure its something I'm not doing in the format of the body of the
message but I can't find that format anywhere.  What am I missing?



Dejan Bosanac wrote:
> 
> Hi the correct url is:
> 
> http://localhost:8161/demo/message/TEST4
> 
> as the REST API is configured under the demo application.
> 
> Take a look at the demo app for more examples: http://localhost:8161/demo
> 
> Also, if you're using PHP, it's generally a better option to use Stomp
> protocol http://activemq.apache.org/stomp.html
> 
> and the appropriate PHP client
> http://stomp.fusesource.org/documentation/php/book.html
> 
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> On Tue, May 18, 2010 at 12:26 AM, dblwizard <david.logan@pgi.com> wrote:
> 
>>
>> Howdy,
>>
>> I am just getting started with ActiveMQ and trying to do a simple test of
>> adding a message to a queue and getting a message from a queue.  Can
>> somebody give a couple of pointers.  Currently I am simply trying to do a
>> POST to add a message to an existing queue.
>>
>> should the the uri be something like:
>>
>> http://localhost:8161/queue/TEST4
>>
>> Where TEST4 is a queue name on my server.  Here is the PHP code that I am
>> trying to use:
>>
>>        $url = 'http://localhost:8161/queue/TEST4/';
>>        $body = 'dbltest message to test activemq';
>>
>>        $session = curl_init($url);
>>        curl_setopt ($session, CURLOPT_POST, true);
>>        curl_setopt ($session, CURLOPT_POSTFIELDS, $body);
>>        curl_setopt($session, CURLOPT_HEADER, false);
>>        curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
>>        $response = curl_exec($session);
>>        curl_close($session);
>>
>>        echo 'my response was:<br>';
>>        echo $response;
>>        echo 'end of response.<br>';
>>
>> This doesn't work ... I get a 404 error.  Can somebody help me figure out
>> what I'm missing?
>>
>> Thanks
>>
>> dbl
>> --
>> View this message in context:
>> http://old.nabble.com/PHP%2C-REST-and-ActiveMQ-tp28589603p28589603.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -----
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 

-- 
View this message in context: http://old.nabble.com/PHP%2C-REST-and-ActiveMQ-tp28589603p28596705.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message