/**
* The standard main method which is used by JVM to start execution of the Java class.
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// Start Spring context for the Consumer
FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext("src/main/resources/SpringBeans.xml");
String total = null;
String host = "localhost";
try {
host = args[0];
total = args[1];
_log.info("-------------------------------------");
_log.info("Active MQ host >>>> "+host);
_log.info("Total messages to send >>>> "+total);
_log.info("-------------------------------------");
// Start the publishing of some messages using regular HTTP POST
sendMessage(host, Integer.valueOf(total));
} catch (Exception e) {
_log.info("------------------------------------------------------------------------------------------------------------------");
_log.info("PAY ATTENTION!!! You must enter the Active MQ host and a number representing the total messages to produce");
_log.info("------------------------------------------------------------------------------------------------------------------");
_log.info("Example: mvn exec:java -Dexec.args=\"localhost 10\"");
System.exit(1);
}
}
Demo.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:activemq
作者:
评论列表
文章目录