简体   繁体   中英

send message to rabbitmq with http request

I'm newbie on rabbitmq and I developed a project based on spring & rabbitmq & AMQP.

I created a Produce.class to create request and put them into rabbitmq based on AMQP and Consumer.class to get message from rabbitmq and process it with java.

now I wanna know is it possible to put the same message with http request. (I create sample web page and I use jquery as client side framework)

I googled but I can't find something usefull.

Thanks.

You can use RabbitMQ web-stomp plug-in

You have to enable the plug-in using:

rabbitmq-plugins enable rabbitmq_web_stomp

Then restart rabbitmq server.

Test the plugin using: http://127.0.0.1:15674/stomp , you should see: Welcome to SockJS!

And as you can see from the web site you can use directly the page:

<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
<script src="stomp.js"></script>
<script>

You can download the stomp.js here : https://raw.github.com/jmesnil/stomp-websocket/master/lib/stomp.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM