当前位置: 首页>>代码示例>>Java>>正文


Java ActiveMQXAConnectionFactory类代码示例

本文整理汇总了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;
}
 
开发者ID:flowable,项目名称:flowable-examples,代码行数:17,代码来源:Configuration.java

示例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();
}
 
开发者ID:messaginghub,项目名称:pooled-jms,代码行数:22,代码来源:XAConnectionPoolTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:ActivationContainerOverwriteIdContainerConfigurationTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:22,代码来源:AMQXASupportTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:25,代码来源:ActivationContainerOverwriteSystemTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:25,代码来源:ActivationContainerOverwriteSystemContainerIdTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:22,代码来源:JMS2AMQTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:23,代码来源:ActivationContainerOverwriteMessageConfigurationTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:24,代码来源:ActivationContainerOverwriteBothConfigurationTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:24,代码来源:MdbContainerTest.java

示例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();
}
 
开发者ID:apache,项目名称:tomee,代码行数:25,代码来源:MdbPoolContainerTest.java

示例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;
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:14,代码来源:ActiveMQTest.java

示例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);
    }
}
 
开发者ID:erik-wramner,项目名称:JmsTools,代码行数:9,代码来源:AmqJmsProducer.java

示例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


注:本文中的org.apache.activemq.ActiveMQXAConnectionFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。