用例是我想在连接后立即向订阅者发送一些配置信息。
InitialContext ic = new InitialContext();
TopicConnectionFactory cf = (TopicConnectionFactory)ic.lookup("java:comp/env/jms/xxx");
Topic topic = (Topic) ic.lookup("java:comp/env/jms/xxx");
TopicConnection conn = cf.createTopicConnection();
TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(topic);