@@ -0,0 +1,1683 @@
+package com.lance.mq.producer.web;%0A%0Aimport java.util.Date;%0A%0Aimport org.apache.commons.lang3.time.DateFormatUtils;%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.ResponseBody;%0A%0Aimport com.lance.mq.producer.service.ProducerService;%0A%0A@Controller%0Apublic class IndexController %7B%0A%09Logger logger = LogManager.getLogger(getClass());%0A%09@Autowired%0A%09private ProducerService producerService;%0A%09%0A%09@RequestMapping(value=%7B%22/%22, %22%22, %22index%22%7D)%0A%09public String index() %7B%0A%09%09return %22index.jsp%22;%0A%09%7D%0A%0A%09@ResponseBody%0A%09@RequestMapping(%22click%22)%0A%09public void click() %7B%0A%09%09String message = %22Hello Queue Message. Date: %22+DateFormatUtils.format(new Date(), %22yyyy-MM-dd HH:mm:ss%22);%0A%09%09%0A%09%09//%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%E4%B8%8D%E8%BF%94%E5%9B%9E%E5%80%BC%0A%09%09producerService.sendTextQueueMessage(message);%0A%09%09%0A%09%09/*%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%E5%B8%A6%E8%BF%94%E5%9B%9E%E5%80%BC%0A%09%09try %7B%0A%09%09%09String result = producerService.sendTextQueueMessageAndReceive(message);%0A%09%09%09logger.info(%22IndexController ====%3E result: %7B%7D, isSuccess: %7B%7D%22, result, result.equals(%22SUCCESS%22));%0A%09%09%7D catch (JMSException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09logger.error(%22%E8%AF%B7%E6%B1%82%E5%8A%A0%E5%85%A5%E9%98%9F%E5%88%97%E5%A4%B1%E8%B4%A5%EF%BC%9A %7B%7D%22, e.getMessage());%0A%09%09%7D*/%0A%09%09%0A%09%09/**%E5%8F%91%E9%80%81%E6%B6%88%E6%81%AF%E5%AF%B9%E8%B1%A1%0A%09%09try %7B%0A%09%09%09OrderInfo info = new OrderInfo(new Random().nextInt(100), message, new Random().nextFloat());%0A%09%09%09String result = producerService.sendObjectQueueMessage(info);%0A%09%09%09logger.info(%22IndexController ====%3E result: %7B%7D, isSuccess: %7B%7D%22, result, result.equals(%22SUCCESS%22));%0A%09%09%7D catch (JMSException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%09logger.error(%22%E8%AF%B7%E6%B1%82%E5%8A%A0%E5%85%A5%E9%98%9F%E5%88%97%E5%A4%B1%E8%B4%A5%EF%BC%9A %7B%7D%22, e.getMessage());%0A%09%09%7D%0A%09%09*/%0A%09%7D%0A%7D%0A

add index controller