锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美精品在线观看,中国av一区,国产精品视频免费http://www.aygfsteel.com/JasonLee/Javazh-cnWed, 18 Jun 2025 09:25:22 GMTWed, 18 Jun 2025 09:25:22 GMT60ActiveMQ瀛︿範http://www.aygfsteel.com/JasonLee/archive/2012/02/11/369793.htmlJasonLeeJasonLeeSat, 11 Feb 2012 06:34:00 GMThttp://www.aygfsteel.com/JasonLee/archive/2012/02/11/369793.htmlhttp://www.aygfsteel.com/JasonLee/comments/369793.htmlhttp://www.aygfsteel.com/JasonLee/archive/2012/02/11/369793.html#Feedback0http://www.aygfsteel.com/JasonLee/comments/commentRss/369793.htmlhttp://www.aygfsteel.com/JasonLee/services/trackbacks/369793.html
 1 import javax.jms.Connection;
 2 import javax.jms.ConnectionFactory;
 3 import javax.jms.Destination;
 4 import javax.jms.MessageConsumer;
 5 import javax.jms.Session;
 6 import javax.jms.TextMessage;
 7 
 8 import org.apache.activemq.ActiveMQConnection;
 9 import org.apache.activemq.ActiveMQConnectionFactory;
10 
11 public class QueueReceive{
12  public static void main(String[] args) {
13 
14   // ConnectionFactory 錛氳繛鎺ュ伐鍘傦紝JMS 鐢ㄥ畠鍒涘緩榪炴帴
15   ConnectionFactory connectionFactory;
16   // Connection 錛欽MS 瀹㈡埛绔埌JMS Provider 鐨勮繛鎺?/span>
17   Connection connection = null;
18   // Session錛?nbsp;涓涓彂閫佹垨鎺ユ敹娑堟伅鐨勭嚎紼?/span>
19   Session session;
20   // Destination 錛氭秷鎭殑鐩殑鍦?娑堟伅鍙戦佺粰璋?
21   Destination destination;
22   // 娑堣垂鑰咃紝娑堟伅鎺ユ敹鑰?/span>
23   MessageConsumer consumer;
24 
25   connectionFactory = new ActiveMQConnectionFactory(
26     ActiveMQConnection.DEFAULT_USER,
27     ActiveMQConnection.DEFAULT_PASSWORD,
28     "tcp://localhost:61616");
29   try {
30    // 鏋勯犱粠宸ュ巶寰楀埌榪炴帴瀵硅薄
31    connection = connectionFactory.createConnection();
32    // 鍚姩
33    connection.start();
34    // 鑾峰彇鎿嶄綔榪炴帴
35    session = connection.createSession(Boolean.FALSE,
36      Session.AUTO_ACKNOWLEDGE);
37    // 鑾峰彇session娉ㄦ剰鍙傛暟鏄竴涓湇鍔″櫒鐨剄ueue錛岄』鍦ㄥ湪ActiveMq鐨刢onsole閰嶇疆
38    destination = session.createQueue("queue1");
39    consumer = session.createConsumer(destination);
40    while (true) {
41     TextMessage message = (TextMessage) consumer.receive(1000);
42     if (null != message) {
43      System.out.println("鏀跺埌娑堟伅" + message.getText());
44 
45     } else {
46      break;
47     }
48 
49    }
50 
51   } catch (Exception e) {
52    e.printStackTrace();
53   } finally {
54    try {
55     if (null != connection)
56      connection.close();
57    } catch (Throwable ignore) {
58    }
59   }
60 
61  }
62 
 1 import javax.jms.Connection;
 2 import javax.jms.ConnectionFactory;
 3 import javax.jms.DeliveryMode;
 4 import javax.jms.Destination;
 5 import javax.jms.MessageProducer;
 6 import javax.jms.Session;
 7 import javax.jms.TextMessage;
 8 
 9 import org.apache.activemq.ActiveMQConnection;
10 import org.apache.activemq.ActiveMQConnectionFactory;
11 
12 public class QueueSend {
13  private static final int SEND_NUMBER = 5;
14 
15  public static void main(String[] args) {
16   // ConnectionFactory 錛氳繛鎺ュ伐鍘傦紝JMS 鐢ㄥ畠鍒涘緩榪炴帴
17   ConnectionFactory connectionFactory;
18   // Connection 錛欽MS 瀹㈡埛绔埌JMS Provider 鐨勮繛鎺?/span>
19   Connection connection = null;
20   // Session錛?nbsp;涓涓彂閫佹垨鎺ユ敹娑堟伅鐨勭嚎紼?/span>
21   Session session;
22   // Destination 錛氭秷鎭殑鐩殑鍦?娑堟伅鍙戦佺粰璋?
23   Destination destination;
24   // MessageProducer錛氭秷鎭彂閫佽?/span>
25   MessageProducer producer;
26   // TextMessage message;
27   // 鏋勯燙onnectionFactory瀹炰緥瀵硅薄錛屾澶勯噰鐢ˋctiveMq鐨勫疄鐜癹ar
28 
29   connectionFactory = new ActiveMQConnectionFactory(
30     ActiveMQConnection.DEFAULT_USER,
31     ActiveMQConnection.DEFAULT_PASSWORD,
32     "tcp://localhost:61616");
33 
34   try {
35    // 鏋勯犱粠宸ュ巶寰楀埌榪炴帴瀵硅薄
36    connection = connectionFactory.createConnection();
37    // 鍚姩
38    connection.start();
39    // 鑾峰彇鎿嶄綔榪炴帴
40    session = connection.createSession(Boolean.TRUE,
41      Session.AUTO_ACKNOWLEDGE);
42    // queue1闇瑕佸湪admin鐣岄潰鍒涘緩
43    destination = session.createQueue("queue1");
44    // 寰楀埌娑堟伅鐢熸垚鑰?/span>
45 
46    producer = session.createProducer(destination);
47    // 璁劇疆涓嶆寔涔呭寲錛屾澶勫涔狅紝瀹為檯鏍規嵁欏圭洰鍐沖畾
48    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
49    // 鏋勯犳秷鎭紝姝ゅ鍐欐錛岄」鐩氨鏄弬鏁幫紝鎴栬呮柟娉曡幏鍙?/span>
50    sendMessage(session, producer);
51    session.commit();
52 
53   } catch (Exception e) {
54    e.printStackTrace();
55   } finally {
56    try {
57     if (null != connection)
58      connection.close();
59    } catch (Throwable ignore) {
60    }
61   }
62 
63  }
64 
65  public static void sendMessage(Session session, MessageProducer producer)
66    throws Exception {
67   for (int i = 1; i <=SEND_NUMBER; i++) {
68    TextMessage message = session
69      .createTextMessage("ActiveMq 鍙戦佺殑娑堟伅" + i);
70    // 鍙戦佹秷鎭埌鐩殑鍦版柟
71    System.out.println("鍙戦佹秷鎭?" + i+"鎴愬姛");
72    producer.send(message);
73   }
74  }
75 }
}


JasonLee 2012-02-11 14:34 鍙戣〃璇勮
]]>
Tuxedo鐨勯氫俊鏂瑰紡http://www.aygfsteel.com/JasonLee/archive/2011/11/08/363188.htmlJasonLeeJasonLeeTue, 08 Nov 2011 08:26:00 GMThttp://www.aygfsteel.com/JasonLee/archive/2011/11/08/363188.htmlhttp://www.aygfsteel.com/JasonLee/comments/363188.htmlhttp://www.aygfsteel.com/JasonLee/archive/2011/11/08/363188.html#Feedback0http://www.aygfsteel.com/JasonLee/comments/commentRss/363188.htmlhttp://www.aygfsteel.com/JasonLee/services/trackbacks/363188.html--------------------------------------
璇鋒眰/搴旂瓟錛堝悓姝ワ紝寮傛錛孴xRPC錛?br />綆¢亾閫氫俊錛堝祵濂楋紝杞彂錛?br />浼氳瘽閫氫俊
浜嬩歡浠g悊(鍙戝竷/璁㈤槄)
娑堟伅閫氬憡錛堝箍鎾?閫氬憡錛?br />闃熷垪鏈哄埗錛堝彲闈犻槦鍒椾紶杈?瀛樺偍杞彂錛?br />--------------------------------------
澶氱閫氫俊緙撳啿鍖猴細
-------------------------------------------------------
CARRAY銆丼TRING銆乂IEW/VIEW32銆丗ML/FML32銆乆ML
-------------------------------------------------------


JasonLee 2011-11-08 16:26 鍙戣〃璇勮
]]>
eclipse浠g爜鑷姩鎻愮ず鍔熻兘 澶辨晥鐨勮В鍐沖姙娉?/title><link>http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362530.html</link><dc:creator>JasonLee</dc:creator><author>JasonLee</author><pubDate>Wed, 02 Nov 2011 06:57:00 GMT</pubDate><guid>http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362530.html</guid><wfw:comment>http://www.aygfsteel.com/JasonLee/comments/362530.html</wfw:comment><comments>http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362530.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/JasonLee/comments/commentRss/362530.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/JasonLee/services/trackbacks/362530.html</trackback:ping><description><![CDATA[    鍙湁娉ㄥ唽鐢ㄦ埛鐧誨綍鍚庢墠鑳介槄璇昏鏂囥?a href='http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362530.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/JasonLee/aggbug/362530.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/JasonLee/" target="_blank">JasonLee</a> 2011-11-02 14:57 <a href="http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362530.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎶曞獎浠數瀛愬寲(E_Projector)http://www.aygfsteel.com/JasonLee/archive/2011/11/02/362527.htmlJasonLeeJasonLeeWed, 02 Nov 2011 06:19:00 GMThttp://www.aygfsteel.com/JasonLee/archive/2011/11/02/362527.htmlhttp://www.aygfsteel.com/JasonLee/comments/362527.htmlhttp://www.aygfsteel.com/JasonLee/archive/2011/11/02/362527.html#Feedback0http://www.aygfsteel.com/JasonLee/comments/commentRss/362527.htmlhttp://www.aygfsteel.com/JasonLee/services/trackbacks/362527.html闃呰鍏ㄦ枃

JasonLee 2011-11-02 14:19 鍙戣〃璇勮
]]>
Jason's Blog http://www.aygfsteel.com/JasonLee/archive/2011/11/01/362476.htmlJasonLeeJasonLeeTue, 01 Nov 2011 13:42:00 GMThttp://www.aygfsteel.com/JasonLee/archive/2011/11/01/362476.htmlhttp://www.aygfsteel.com/JasonLee/comments/362476.htmlhttp://www.aygfsteel.com/JasonLee/archive/2011/11/01/362476.html#Feedback0http://www.aygfsteel.com/JasonLee/comments/commentRss/362476.htmlhttp://www.aygfsteel.com/JasonLee/services/trackbacks/362476.html

JasonLee 2011-11-01 21:42 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 神木县| 比如县| 济南市| 黄梅县| 内江市| 长泰县| 沁阳市| 融水| 边坝县| 台东市| 襄樊市| 汪清县| 中山市| 昌乐县| 理塘县| 新和县| 明星| 武安市| 乌海市| 永济市| 淮安市| 额济纳旗| 石首市| 天全县| 封开县| 九江县| 凉城县| 钦州市| 鄂伦春自治旗| 太白县| 长葛市| 轮台县| 榆中县| 寻乌县| 若尔盖县| 西乌| 齐河县| 德保县| 甘泉县| 定远县| 贵州省|