本文整理汇总了Java中org.apache.activemq.ActiveMQXAConnectionFactory类的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQXAConnectionFactory类的具体用法?Java ActiveMQXAConnectionFactory怎么用?Java ActiveMQXAConnectionFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ActiveMQXAConnectionFactory类属于org.apache.activemq包,在下文中一共展示了ActiveMQXAConnectionFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: connectionFactory
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Bean(initMethod = "init", destroyMethod = "close")
public ConnectionFactory connectionFactory() {
ActiveMQXAConnectionFactory activeMQXAConnectionFactory = new ActiveMQXAConnectionFactory();
activeMQXAConnectionFactory.setUseAsyncSend(true);
activeMQXAConnectionFactory.setAlwaysSessionAsync(true);
activeMQXAConnectionFactory.setStatsEnabled(true);
activeMQXAConnectionFactory.setBrokerURL("tcp://127.0.0.1:61616");
AtomikosConnectionFactoryBean atomikosConnectionFactoryBean = new AtomikosConnectionFactoryBean();
atomikosConnectionFactoryBean.setUniqueResourceName("xamq");
atomikosConnectionFactoryBean.setLocalTransactionMode(false);
atomikosConnectionFactoryBean.setMaxPoolSize(100);
atomikosConnectionFactoryBean.setBorrowConnectionTimeout(30000);
atomikosConnectionFactoryBean.setXaConnectionFactory(activeMQXAConnectionFactory);
return atomikosConnectionFactoryBean;
}
示例2: testSenderAndPublisherDest
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Test(timeout = 60000)
public void testSenderAndPublisherDest() throws Exception {
JmsPoolXAConnectionFactory pcf = new JmsPoolXAConnectionFactory();
pcf.setConnectionFactory(new ActiveMQXAConnectionFactory(
"vm://test?broker.persistent=false&broker.useJmx=false"));
QueueConnection connection = pcf.createQueueConnection();
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(session.createQueue("AA"));
assertNotNull(sender.getQueue().getQueueName());
connection.close();
TopicConnection topicConnection = pcf.createTopicConnection();
TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
TopicPublisher topicPublisher = topicSession.createPublisher(topicSession.createTopic("AA"));
assertNotNull(topicPublisher.getTopic().getTopicName());
topicConnection.close();
pcf.stop();
}
示例3: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdb.container.amq.activation.destination","wrongTarget")
.p("mdbs.activation.destination", "target")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例4: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例5: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
System.setProperty("mdbs.activation.destination", "wrongTarget");
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.activation.destination", "target")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例6: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
System.setProperty("mdb.container.amq.activation.destination", "wrongTarget");
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.activation.destination", "target")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例7: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例8: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.activation.destination", "target")
.p("mdbs.activation.destinationType", "javax.jms.Queue")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:ActivationContainerOverwriteReadTheContainerConfigurationTest.java
示例9: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.activation.destination", "target")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例10: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdb.container.amq.activation.destination","wrongTarget")
.p("mdbs.activation.destination", "target")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.build();
}
示例11: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.pool", "false")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.p("mdb.activation.ignore", "testString")
.p("mdb.activation.ignore2", "testString")
.p("openejb.provider.default", "org.apache.openejb.actpropfalse") // service-jar.xml with FailOnUnknowActivationSpec = false
.build();
}
示例12: config
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Configuration
public Properties config() {
return new PropertiesBuilder()
.p("amq", "new://Resource?type=ActiveMQResourceAdapter")
.p("amq.DataSource", "")
.p("amq.BrokerXmlConfig", "broker:(vm://localhost)")
.p("target", "new://Resource?type=Queue")
.p("mdbs", "new://Container?type=MESSAGE")
.p("mdbs.ResourceAdapter", "amq")
.p("mdbs.pool", "true")
.p("cf", "new://Resource?type=" + ConnectionFactory.class.getName())
.p("cf.ResourceAdapter", "amq")
.p("xaCf", "new://Resource?class-name=" + ActiveMQXAConnectionFactory.class.getName())
.p("xaCf.BrokerURL", "vm://localhost")
.p("mdb.activation.ignore", "testString")
.p("mdb.activation.ignore2", "testString")
.p("openejb.provider.default", "org.apache.openejb.actpropfalse") // service-jar.xml with FailOnUnknowActivationSpec = false
.build();
}
示例13: createCF
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
private ConnectionFactory createCF(String brokerUrl) throws Exception {
ConnectionFactory cf = ManagedConnectionFactoryBuilder.builder()
.transaction(TransactionSupportLevel.XATransaction)
.transactionManager(tm)
.name("vmbroker" + brokerId++ )
.connectionFactory(new ActiveMQConnectionFactory(brokerUrl),
new ActiveMQXAConnectionFactory(brokerUrl))
.build();
if (cf instanceof AutoCloseable) {
closeables.add((AutoCloseable) cf);
}
return cf;
}
示例14: createXAConnectionFactory
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Override
public XAConnectionFactory createXAConnectionFactory() throws JMSException {
if (_userName != null && _password != null) {
return new ActiveMQXAConnectionFactory(_userName, _password, _brokerUrl);
} else {
return new ActiveMQXAConnectionFactory(_brokerUrl);
}
}
示例15: jmsConnectionFactory
import org.apache.activemq.ActiveMQXAConnectionFactory; //导入依赖的package包/类
@Primary
@Bean(name = { "jmsConnectionFactory", "xaJmsConnectionFactory" })
public ConnectionFactory jmsConnectionFactory(ActiveMQProperties properties,
XAConnectionFactoryWrapper wrapper) throws Exception {
ActiveMQXAConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory(
properties).createConnectionFactory(ActiveMQXAConnectionFactory.class);
return wrapper.wrapConnectionFactory(connectionFactory);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:ActiveMQXAConnectionFactoryConfiguration.java