title: Java EE Websocket: How to send keep sending data without receiving message?
body: <p><strong>What I want?</strong><br>
  I am trying to write an application where client sends a query and based on the query server gets twitter-stream and pushes to client.  </p>
  
  <p><strong>What I have?</strong><br>
  I have a simple structure in place where client can connect to server and server responds back  </p>
  
  <p><strong>TweetStreamServer</strong>  </p>
  
  <pre><code>package com.self.tweetstream;
  
  import javax.websocket.OnMessage;
  import javax.websocket.server.ServerEndpoint;
  
  @ServerEndpoint("/tweets")
  public class TweetStreamServer {
      @OnMessage
      public String tweets(final String message) {
          return message;
      }
  }
  </code></pre>
  
  <p><strong>TweetStreamClient</strong>  </p>
  
  <pre><code>@ClientEndpoint
  public class TweetStreamClient {
      public static CountDownLatch latch;
      public static String response;
  
      @OnOpen
      public void onOpen(Session session) {
          try{
              session.getBasicRemote().sendText("Hello World!");
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  
      @OnMessage
      public void printTweets(final String tweet) {
          System.out.println("Tweet:" + tweet);
          response = tweet;
          latch.countDown();
      }
  }
  </code></pre>
  
  <p><strong>TweetStreamTest</strong>  </p>
  
  <pre><code>@Test
      public void test() throws URISyntaxException, IOException, DeploymentException, InterruptedException {
          System.out.println("URI: " + getEndpointUrl());
          TweetStreamClient.latch = new CountDownLatch(1);
          Session session = connectToServer(TweetStreamClient.class, "tweets");
          assertNotNull(session);
          assertTrue(TweetStreamClient.latch.await(10, TimeUnit.SECONDS));
          assertEquals("Hello World!", TweetStreamClient.response);
      }
  </code></pre>
  
  <p><strong>Question</strong><br>
  I am confused how can I now send continuous tweets that I receive from Twitter because my server method as per API is  </p>
  
  <pre><code>       @OnMessage
          public String tweets(final String message) {
              return message;
          }  
  </code></pre>
  
  <p>This means it expects a message in order return anything.  </p>
  
  <p>How can I send on-coming data from Twitter send to client?</p>