當前位置: 首頁>>代碼示例>>Java>>正文


Java ActiveMQConnectionFactory.setOptimizeAcknowledge方法代碼示例

本文整理匯總了Java中org.apache.activemq.ActiveMQConnectionFactory.setOptimizeAcknowledge方法的典型用法代碼示例。如果您正苦於以下問題:Java ActiveMQConnectionFactory.setOptimizeAcknowledge方法的具體用法?Java ActiveMQConnectionFactory.setOptimizeAcknowledge怎麽用?Java ActiveMQConnectionFactory.setOptimizeAcknowledge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.activemq.ActiveMQConnectionFactory的用法示例。


在下文中一共展示了ActiveMQConnectionFactory.setOptimizeAcknowledge方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
private static ConnectionFactory createConnectionFactory(String options, Integer maximumRedeliveries) {
        // using a unique broker name improves testing when running the entire test suite in the same JVM
        int id = counter.incrementAndGet();
        String url = "tcp://192.168.3.103:61618";
//        if (options != null) {
//            url = url + "&" + options;
//        }
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
        // optimize AMQ to be as fast as possible so unit testing is quicker
        connectionFactory.setCopyMessageOnSend(false);
        connectionFactory.setOptimizeAcknowledge(true);
        connectionFactory.setOptimizedMessageDispatch(true);
        // When using asyncSend, producers will not be guaranteed to send in the order we
        // have in the tests (which may be confusing for queues) so we need this set to false.
        // Another way of guaranteeing order is to use persistent messages or transactions.
        connectionFactory.setUseAsyncSend(false);
        connectionFactory.setAlwaysSessionAsync(false);
        if (maximumRedeliveries != null) {
            connectionFactory.getRedeliveryPolicy().setMaximumRedeliveries(maximumRedeliveries);
        }
//        connectionFactory.setTrustAllPackages(true);
        return connectionFactory;
    }
 
開發者ID:eXcellme,項目名稱:eds,代碼行數:24,代碼來源:CamelJmsTestHelper.java

示例2: createPersistentConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
private static ConnectionFactory createPersistentConnectionFactory(String options) {
        // using a unique broker name improves testing when running the entire test suite in the same JVM
        int id = counter.incrementAndGet();

        // use an unique data directory in target
        String dir = "target/activemq-data-" + id;

        // remove dir so its empty on startup
        FileUtil.removeDir(new File(dir));

        String url = "vm://test-broker-" + id + "?broker.persistent=true&broker.useJmx=false&broker.dataDirectory=" + dir;
        if (options != null) {
            url = url + "&" + options;
        }
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
        // optimize AMQ to be as fast as possible so unit testing is quicker
        connectionFactory.setCopyMessageOnSend(false);
        connectionFactory.setOptimizeAcknowledge(true);
        connectionFactory.setOptimizedMessageDispatch(true);
        connectionFactory.setAlwaysSessionAsync(false);
//        connectionFactory.setTrustAllPackages(true);
        return connectionFactory;
    }
 
開發者ID:eXcellme,項目名稱:eds,代碼行數:24,代碼來源:CamelJmsTestHelper.java

示例3: createConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createConnectionFactory(String options) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();
    String url = "vm://test-broker-" + id + "?broker.persistent=false&broker.useJmx=false";
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);
    connectionFactory.setTrustAllPackages(true);

    // When using asyncSend, producers will not be guaranteed to send in the order we 
    // have in the tests (which may be confusing for queues) so we need this set to false.
    // Another way of guaranteeing order is to use persistent messages or transactions.
    connectionFactory.setUseAsyncSend(false);

    connectionFactory.setAlwaysSessionAsync(false);
    // use a pooled connection factory
    PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
    pooled.setMaxConnections(8);
    return pooled;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:26,代碼來源:CamelJmsTestHelper.java

示例4: createConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createConnectionFactory(String options, Integer maximumRedeliveries) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();
    String url = "vm://test-broker-" + id + "?broker.persistent=false&broker.useJmx=false";
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);
    // When using asyncSend, producers will not be guaranteed to send in the order we
    // have in the tests (which may be confusing for queues) so we need this set to false.
    // Another way of guaranteeing order is to use persistent messages or transactions.
    connectionFactory.setUseAsyncSend(false);
    connectionFactory.setAlwaysSessionAsync(false);
    if (maximumRedeliveries != null) {
        connectionFactory.getRedeliveryPolicy().setMaximumRedeliveries(maximumRedeliveries);
    }
    connectionFactory.setTrustAllPackages(true);
    return connectionFactory;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:24,代碼來源:CamelJmsTestHelper.java

示例5: createPersistentConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createPersistentConnectionFactory(String options) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();

    // use an unique data directory in target
    String dir = "target/activemq-data-" + id;

    // remove dir so its empty on startup
    FileUtil.removeDir(new File(dir));

    String url = "vm://test-broker-" + id + "?broker.persistent=true&broker.useJmx=false&broker.dataDirectory=" + dir;
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);
    connectionFactory.setAlwaysSessionAsync(false);
    connectionFactory.setTrustAllPackages(true);
    return connectionFactory;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:24,代碼來源:CamelJmsTestHelper.java

示例6: createConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createConnectionFactory(String options) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();
    String url = "vm://test-broker-" + id + "?broker.persistent=false&broker.useJmx=false";
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);

    // When using asyncSend, producers will not be guaranteed to send in the order we
    // have in the tests (which may be confusing for queues) so we need this set to false.
    // Another way of guaranteeing order is to use persistent messages or transactions.
    connectionFactory.setUseAsyncSend(false);

    connectionFactory.setAlwaysSessionAsync(false);
    // use a pooled connection factory
    PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
    pooled.setMaxConnections(8);
    return pooled;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:25,代碼來源:CamelJmsTestHelper.java

示例7: createPersistentConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createPersistentConnectionFactory(String options) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();

    // use an unique data directory in target
    String dir = "target/activemq-data-" + id;

    // remove dir so its empty on startup
    FileUtil.removeDir(new File(dir));

    String url = "vm://test-broker-" + id + "?broker.persistent=true&broker.useJmx=false&broker.dataDirectory=" + dir;
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);
    connectionFactory.setUseAsyncSend(true);
    connectionFactory.setAlwaysSessionAsync(false);
    connectionFactory.setTrustAllPackages(true);

    // use a pooled connection factory
    PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
    pooled.setMaxConnections(8);
    return pooled;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:29,代碼來源:CamelJmsTestHelper.java

示例8: createPersistentConnectionFactory

import org.apache.activemq.ActiveMQConnectionFactory; //導入方法依賴的package包/類
public static ConnectionFactory createPersistentConnectionFactory(String options) {
    // using a unique broker name improves testing when running the entire test suite in the same JVM
    int id = counter.incrementAndGet();

    // use an unique data directory in target
    String dir = "target/activemq-data-" + id;

    // remove dir so its empty on startup
    FileUtil.removeDir(new File(dir));

    String url = "vm://test-broker-" + id + "?broker.persistent=true&broker.useJmx=false&broker.dataDirectory=" + dir;
    if (options != null) {
        url = url + "&" + options;
    }
    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
    // optimize AMQ to be as fast as possible so unit testing is quicker
    connectionFactory.setCopyMessageOnSend(false);
    connectionFactory.setOptimizeAcknowledge(true);
    connectionFactory.setOptimizedMessageDispatch(true);
    connectionFactory.setUseAsyncSend(true);
    connectionFactory.setAlwaysSessionAsync(false);

    // use a pooled connection factory
    PooledConnectionFactory pooled = new PooledConnectionFactory(connectionFactory);
    pooled.setMaxConnections(8);
    return pooled;
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:28,代碼來源:CamelJmsTestHelper.java


注:本文中的org.apache.activemq.ActiveMQConnectionFactory.setOptimizeAcknowledge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。