[rabbitmq-discuss] Sending HTTP Request in Rabbit-MQ
tim at rabbitmq.com
Tue Dec 18 13:33:41 GMT 2012
Aravind, what you're asking doesn't make a great deal of sense to me. What is it you're trying to achieve? Do you want to relay HTTP traffic via RabbitMQ to a web server, or from one web server to another, or something else? Have you considered using an HTTP enabled plugin such as the STOMP adapter to achieve this?
Anyway, if you're just trying to relay messages between HTTP/AMQP then writing an adapter shouldn't be too hard. For AMQP => HTTP => AMQP (i.e., an rpc request to AMQP that gets processed 'in the middle' by a servlet application running in Tomcat) is quite simple to implement. Write your AMQP client code to consume the message from Rabbit. Turn the message headers into HTTP headers and transform/convert the payload if necessary, then execute the HTTP request. Once the HTTPClient return a response, reverse the process and pack everything back into AMQP.
As I said, if you don't want to write this by hand then you can use the web-stomp plugin or something similar to expose queues/exchanges via HTTP, but I get the impression that's not what you're trying to do.
On 17 Dec 2012, at 10:52, <aravindan.santharam at accenture.com> <aravindan.santharam at accenture.com> wrote:
> I'm trying to send the instances of HTTPServletRequest, HTTPServletResponse and HttpMethod in rabbitmq(in Java). At present, we are sending this request using executeMethod() of HTTPClient.
> It is very obvious that we cannot serialize the above mentioned classes. I want to know is there a way to send the HTTP Request via rabbitmq and to invoke that in tomcat.
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited.
> Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss