Hi. I'm very interested in using rabbitmq. I've tried all the examples in Rabbit website and its work.Now I want to do something further but I could not know how to do it.I installed the rabbitmq server in one computer (rabbit server computer) and I will user another computer as a client to push the message to rabbit server. What should I need to configure in my client java code?<br>
Something like this:<br> public static void main(String[] argv) throws Exception {<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
ConnectionFactory factory = new ConnectionFactory();<br>
factory.setHost("<a href="http://10.2.17.66:4369">10.2.17.66:4369</a>"); (it's not localhost anymore, intead of this, the host has to be the server address and rabbit port number)<br> Connection connection = factory.newConnection();<br>
Channel channel = connection.createChannel();<br><br> channel.exchangeDeclare(EXCHANGE_NAME, "fanout");<br> String message = "Hello world";<br> <br> channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes());<br>
System.out.println(" [x] Sent '" + message + "'");<br><br> channel.close();<br> connection.close();<br> }<br></blockquote><div><br>I tried but it didn't work.What should I do?<br>
Thanks a lot.<br></div><br>