// There will be a response pending so the case is different
publishLatch.set(new CountDownLatch(1));
connectLatch.set(new CountDownLatch(1));
String serviceChannelName = "/service/test";
final ServerChannel serviceChannel = bayeux.createChannelIfAbsent(serviceChannelName, new Persistent()).getReference();
serviceChannel.addListener(new ServerChannel.MessageListener()
{
public boolean onMessage(ServerSession from, ServerChannel channel, ServerMessage.Mutable message)
{
bayeux.getChannel(channelName).publish(emitter, data);
return true;