blazeds服务器给客户端发送消息

private String clientID = UUIDUtils.createUUID();
	public void sendMessage(){
		MessageBroker mb=MessageBroker.getMessageBroker(null);
		AsyncMessage asy=new AsyncMessage();
		asy.setDestination("allroom");
		asy.setClientId(clientID);
		
		asy.setMessageId(UUIDUtils.createUUID());
		
		ASObject as=new ASObject(); 
		as.put("hello", "etsetsatet");
		asy.setBody(as);
		
		mb.routeMessageToService(asy,null);
		
		System.out.println(mb+"messageBroker");
	}

你可能感兴趣的:(blazeds)