title: RabbitMQ, CloudFoundry, and an External Sender
body: <p>So right now I am messing around with RabbitMQ on cloud foundry. Im just working with the basics and trying to get a handle on it all. </p>
  
  <p>I have the RabbitMQ client deployed on my cloud foundry instance and I have a spring application running and I can send and receive within the cloud. </p>
  
  <p>Example I went off of word for word is <a href="https://github.com/cloudfoundry-samples/rabbitmq-cloudfoundry-samples/tree/master/spring" rel="nofollow">HERE</a></p>
  
  <p>Now I am looking to send to the cloud from an exterior application. I think I might be having a hard time grasping this concept. </p>
  
  <p>What I was trying to do is use the 'messages' queue created by the example program to push messages too. ( I think this is my misunderstanding). </p>
  
  <p>Can I send messages straight to the client or do I have to have a middle man receiver bined to the client?</p>
  
  <p>This was how I was trying to test the connection and send a message but I get a java.lang.IllegalArgumentException: URI is not absolute.</p>
  
  <p>The username, password, virtual host, and other information was taken straight from the client itself.</p>
  
  <pre><code>  public void testConnection() throws java.io.IOException {
  
    ConnectionFactory factory = new ConnectionFactory();
  
      factory.setUsername("xxxxxxx");
      factory.setPassword("xxxxxxxxxxxx");
      factory.setVirtualHost("xxxxxxxxxxxx");
      factory.setHost("xx.xx.xxx.xx");
      factory.setPort(xxxx);
      Connection conn = factory.newConnection();
      Connection connection = factory.newConnection();
      Channel channel = connection.createChannel();
  
  
  
      channel.queueDeclare(QUEUE_NAME, false, false, false, null);
      String message = "Hello From The Outside!!!";
      channel.basicPublish("", QUEUE_NAME, null, message.getBytes());
      System.out.println(" [x] Sent '" + message + "'");
      channel.close();
      conn.close();
  </code></pre>
  
  <p>What idea am I missing here? Sender, receiver(maybe what im missing), Client to do the queueing (and this is where I want to end for now)</p>