資源簡介
apache-apollo-1.7.1
代碼片段和文件信息
/**
?*?Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one?or?more
?*?contributor?license?agreements.??See?the?NOTICE?file?distributed?with
?*?this?work?for?additional?information?regarding?copyright?ownership.
?*?The?ASF?licenses?this?file?to?You?under?the?Apache?License?Version?2.0
?*?(the?“License“);?you?may?not?use?this?file?except?in?compliance?with
?*?the?License.??You?may?obtain?a?copy?of?the?License?at
?*
?*??????http://www.apache.org/licenses/LICENSE-2.0
?*
?*?Unless?required?by?applicable?law?or?agreed?to?in?writing?software
?*?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
?*?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
?*?See?the?License?for?the?specific?language?governing?permissions?and
?*?limitations?under?the?License.
?*/
package?example;
import?org.apache.qpid.amqp_1_0.jms.impl.*;
import?javax.jms.*;
class?Listener?{
????public?static?void?main(String?[]args)?throws?JMSException?{
????????String?user?=?env(“APOLLO_USER“?“admin“);
????????String?password?=?env(“APOLLO_PASSWORD“?“password“);
????????String?host?=?env(“APOLLO_HOST“?“localhost“);
????????int?port?=?Integer.parseInt(env(“APOLLO_PORT“?“61613“));
????????String?destination?=?arg(args?0?“topic://event“);
????????ConnectionFactoryImpl?factory?=?new?ConnectionFactoryImpl(host?port?user?password);
????????Destination?dest?=?null;
????????if(?destination.startsWith(“topic://“)?)?{
????????????dest?=?new?TopicImpl(destination);
????????}?else?{
????????????dest?=?new?QueueImpl(destination);
????????}
????????Connection?connection?=?factory.createConnection(user?password);
????????connection.start();
????????Session?session?=?connection.createSession(false?Session.AUTO_ACKNOWLEDGE);
????????MessageConsumer?consumer?=?session.createConsumer(dest);
????????long?start?=?System.currentTimeMillis();
????????long?count?=?1;
????????System.out.println(“Waiting?for?messages...“);
????????while(true)?{
????????????Message?msg?=?consumer.receive();
????????????if(?msg?instanceof??TextMessage?)?{
????????????????String?body?=?((TextMessage)?msg).getText();
????????????????if(?“SHUTDOWN“.equals(body))?{
????????????????????long?diff?=?System.currentTimeMillis()?-?start;
????????????????????System.out.println(String.format(“Received?%d?in?%.2f?seconds“?count?(1.0*diff/1000.0)));
????????????????????connection.close();
????????????????????System.exit(1);
????????????????}?else?{
????????????????????try?{
????????????????????????if(?count?!=?msg.getIntProperty(“id“)?)?{
????????????????????????????System.out.println(“mismatch:?“+count+“!=“+msg.getIntProperty(“id“));
????????????????????????}
????????????????????}?catch?(NumberFormatException?ignore)?{
????????????????????}
????????????????????if(?count?==?1?)?{
????????????????????????start?=?System.currentTimeMillis();
????????????????????}?else?if(?count?%?1000?==?0?)?{
????????????????????????System.o
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-01-29?10:55??apache-apollo-1.7.1\
?????目錄???????????0??2015-01-29?10:55??apache-apollo-1.7.1\lib\
?????文件??????123878??2015-01-29?10:54??apache-apollo-1.7.1\lib\apollo-cli-1.7.1.jar
?????文件?????7114639??2014-11-20?18:56??apache-apollo-1.7.1\lib\scala-library-2.10.0.jar
?????文件???????86653??2014-12-03?12:12??apache-apollo-1.7.1\lib\airline-0.6.jar
?????文件????????2497??2014-11-20?18:45??apache-apollo-1.7.1\lib\javax.inject-1.jar
?????文件?????1795936??2014-11-25?08:18??apache-apollo-1.7.1\lib\guava-12.0.jar
?????文件??????114415??2014-11-20?18:29??apache-apollo-1.7.1\lib\jansi-1.11.jar
?????文件??????131443??2014-12-02?09:07??apache-apollo-1.7.1\lib\jasypt-1.6.jar
?????文件??????207723??2014-11-20?18:18??apache-apollo-1.7.1\lib\commons-lang-2.1.jar
?????文件???????18874??2014-12-02?09:07??apache-apollo-1.7.1\lib\commons-codec-1.1.jar
?????文件??????416580??2015-01-29?10:49??apache-apollo-1.7.1\lib\apollo-leveldb-1.7.1.jar
?????文件?????1778184??2015-01-29?10:47??apache-apollo-1.7.1\lib\apollo-broker-1.7.1.jar
?????文件???????83968??2015-01-29?10:46??apache-apollo-1.7.1\lib\apollo-dto-1.7.1.jar
?????文件??????206234??2014-12-02?09:07??apache-apollo-1.7.1\lib\jackson-core-2.1.0.jar
?????文件???????34251??2014-12-02?09:07??apache-apollo-1.7.1\lib\jackson-annotations-2.1.0.jar
?????文件??????920971??2014-12-02?09:07??apache-apollo-1.7.1\lib\jackson-databind-2.1.0.jar
?????文件??????471795??2015-01-29?10:46??apache-apollo-1.7.1\lib\apollo-util-1.7.1.jar
?????文件???????25496??2014-12-02?09:07??apache-apollo-1.7.1\lib\slf4j-api-1.6.1.jar
?????文件??????106334??2015-01-29?10:46??apache-apollo-1.7.1\lib\apollo-selector-1.7.1.jar
?????文件??????127595??2014-11-26?09:47??apache-apollo-1.7.1\lib\hawtdispatch-transport-1.20.jar
?????文件??????119046??2014-11-26?09:47??apache-apollo-1.7.1\lib\hawtdispatch-1.20.jar
?????文件??????137411??2014-11-20?19:29??apache-apollo-1.7.1\lib\hawtdispatch-scala-1.20.jar
?????文件???????30878??2014-11-20?19:29??apache-apollo-1.7.1\lib\activemq-jaas-5.7.0.jar
?????文件???????27252??2014-11-20?19:29??apache-apollo-1.7.1\lib\hawtbuf-proto-1.10.jar
?????文件???????50150??2014-11-24?15:28??apache-apollo-1.7.1\lib\hawtbuf-1.10.jar
?????文件??????253432??2014-11-20?19:29??apache-apollo-1.7.1\lib\snakeyaml-1.7.jar
?????文件????????9242??2014-11-20?18:51??apache-apollo-1.7.1\lib\leveldb-api-0.6.jar
?????文件??????228800??2014-11-20?18:51??apache-apollo-1.7.1\lib\leveldb-0.6.jar
?????文件???????56364??2014-11-25?08:18??apache-apollo-1.7.1\lib\leveldbjni-1.8.jar
?????文件???????19705??2014-11-25?08:18??apache-apollo-1.7.1\lib\hawtjni-runtime-1.9.jar
............此處省略1178個文件信息
- 上一篇:人才系統源碼
- 下一篇:zookeeper-3.4.8解壓即用低分版
評論
共有 條評論