📄 testmain.java
字号:
package com.andyao.activemq;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class TestMain {
public static void main(String[] args) {
ListableBeanFactory lsb = new ClassPathXmlApplicationContext("classpath:com/andyao/activemq/applicationContext-activemq.xml");
GenericBeanFactoryAccessor gba = new GenericBeanFactoryAccessor(lsb);
TopicMessageProducer fmpa = gba.getBean("topicMessageProducer");
QueueMessageProducer fmpb = gba.getBean("queueMessageProducer");
int count = 1;
while (true) {
FooMessage fm = new FooMessage();
fm.setId(count);
fmpa.send(fm);
fmpb.send(fm);
count ++;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -