public void run() {
		Connection connection = null;
		try {
			// 创建Connection,每个consumer有一个,需要自己不能关闭
			connection = JmsUtil.getConnection();
			// 创建Session
			session = connection.createSession(transacted, ackMode);
			//目标对象
			Destination destination = null;
			if (topic) {
				destination = session.createTopic(destinationReg);
			} else {
				destination = session.createQueue(destinationReg);
			}

			if (durable && topic) {
				consumer = session.createDurableSubscriber((Topic) destination,	consumerName);
			} else {
				consumer = session.createConsumer(destination);
			}
			//创建消息监听器
			messageListener = new ProcessRecordsListener( session);
			
			//当指定接收maxiumMessages数量的消息时，就消费maxiumMessages量，然后退出
			if (maxiumMessages > 0) {
				consumeMessagesAndClose(connection, session, consumer);
			} else {
				//没有指定多长时间间隔取一次消息
				if (receiveTimeOut == 0) {
					consumer.setMessageListener(messageListener);
				} else {
					//指定时间间隔后进入此方法
					consumeMessagesAndClose(connection, session, consumer, receiveTimeOut);
				}
			}
		} catch (Exception e) {
			this.closeConsumerAndSession();
			LOG.error("启动线程进行消费消息出错",e);
		}
	}