title: implementation in cometD
body: <p>I am new to CometD, Is there any simple example to implement service channel model in case of response/request model. I have seen cometd.org but there is no such example to how to send the response back if i publish to any channel.</p>
  
  <p>This is the client side</p>
  
  <pre><code>alert("channel published1");
      dojox.cometd.publish('/service/getlist');   
      alert("channel published");
      dojox.cometd.subscribe('/service/getlist', function(message) {
          alert(message);
      });
  </code></pre>
  
  <p>this is server side "ConfigurationServlet"</p>
  
  <pre><code>bayeux.createIfAbsent("/service/getlist", new ConfigurableServerChannel.Initializer() {
  
          //new EchoService(bayeux);
          @Override
          public void configureChannel(ConfigurableServerChannel channel) {
              /*channel.setPersistent(true);
              GetListChannelListener channelListner = new GetOrderListChannelListener();
              channel.addListener(channelListner);*/
              new EchoService(bayeux);
          }
      });
  </code></pre>
  
  <p>EchoService</p>
  
  <pre><code>public class EchoService extends AbstractService{
  public EchoService(BayeuxServer bayeuxServer)                                 
  {
      super(bayeuxServer, "getlist");                                              
      addService("/service/getlist", "processEcho");                                       
  }
  
  public void processEcho(ServerSession remote,Map&lt;String, Object&gt; data)
  {       
      try{
      System.out.println("Start Process Echo");
      getBayeux().getChannel("/service/getlist").publish(getServerSession(), "Hello", null);
      System.out.println("End Process Echo");
      }catch(Exception exp){
          exp.printStackTrace();
      }
      //remote.deliver(getServerSession(), "/service/getlist", data, null);                  
  }
  </code></pre>
  
  <p>}</p>