@PostConstruct
    public void send(){
        MsgObj msg = new MsgObj();
        msg.setMessageCode(110);
        msg.setMessageContent("有色狼");
        Timer t =new Timer("test");
        //循环发送
        t.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                while (true){
                    template.send(requestDestination,new MessageCreator() {
                        @Override
                        public Message createMessage(Session session) throws JMSException {
                            Message msg =session.createTextMessage("有色狼");
                            msg.setJMSMessageID("110");
                            msg.setJMSReplyTo(responseDestination);
                            return msg;
                        }
                    });
                    try {
                        Thread.sleep(2000);
                    }catch (Exception e){

                    }

                }

            }
        },5000,2000);

    }