Code example for Queue

Methods: toArray

0
	} 
 
	@RequestMapping(value = "/chatlog") 
	@ResponseBody 
	public String chatlog() {
		return StringUtils.arrayToDelimitedString(this.chatMessages.toArray(),
				"<br/>"); 
	} 
 
	/** 
	 * This method is invoked when a RabbitMQ Message is received. 
	 */ 
	public void handleChatMessage(String message) {
		if (chatMessages.size() > 100) {
			chatMessages.remove();
			// mostra solo gli ultimi 100 
		} 
		//List<ChatMessage> m = mongoTemplate.find(query(where("routingKey").is("chatQueue")), ChatMessage.class);         
		chatMessages.add(message);
	} 
Connect your IDE to all the code out there  Get Codota for Java