锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲人成人一区二区在线观看,成人亚洲综合天堂,久久久久中文字幕2018http://www.aygfsteel.com/JasonLee/Javazh-cnSun, 27 Jul 2025 12:07:58 GMTSun, 27 Jul 2025 12:07:58 GMT60ActiveMQ瀛︿範(fàn)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    // 璁劇疆涓嶆寔涔呭寲錛屾澶勫涔?fàn)锛屽疄闄呮犚?guī)嵁欏圭洰鍐沖畾
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 />浼?xì)璇濋€氫俊
浜嬩歡浠g悊(鍙戝竷/璁㈤槄)
娑堟伅閫氬憡錛堝箍鎾?閫氬憡錛?br />闃熷垪鏈哄埗錛堝彲闈犻槦鍒椾紶杈?瀛樺偍杞彂錛?br />--------------------------------------
澶氱閫氫俊緙撳啿鍖猴細(xì)
-------------------------------------------------------
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>鎶曞獎(jiǎng)浠數(shù)瀛愬寲(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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 康乐县| 东安县| 全椒县| 方山县| 凤山市| 平南县| 光泽县| 民丰县| 秦皇岛市| 海丰县| 南充市| 昭通市| 曲阳县| 屯留县| 奉化市| 平乐县| 齐河县| 永嘉县| 门头沟区| 财经| 新竹县| 大关县| 青神县| 洪江市| 瓦房店市| 施甸县| 邵武市| 额敏县| 北海市| 嘉义市| 卢氏县| 昂仁县| 友谊县| 信宜市| 白沙| 法库县| 禹城市| 延津县| 宾阳县| 电白县| 广水市|