本文整理匯總了Java中org.apache.activemq.broker.BrokerService.setAdvisorySupport方法的典型用法代碼示例。如果您正苦於以下問題:Java BrokerService.setAdvisorySupport方法的具體用法?Java BrokerService.setAdvisorySupport怎麽用?Java BrokerService.setAdvisorySupport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.activemq.broker.BrokerService
的用法示例。
在下文中一共展示了BrokerService.setAdvisorySupport方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Before
@Override
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setUseJmx(false);
brokerService.setAdvisorySupport(false);
brokerService.setSchedulerSupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
connectionUri = connector.getPublishableConnectString();
factory = new ActiveMQConnectionFactory(connectionUri);
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
pooledFactory.setMaxConnections(1);
pooledFactory.setBlockIfSessionPoolIsFull(false);
pooledFactory.setMaximumActiveSessionPerConnection(1);
}
示例2: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setUseJmx(false);
brokerService.setAdvisorySupport(false);
brokerService.setSchedulerSupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
connectionUri = connector.getPublishableConnectString();
factory = new ActiveMQConnectionFactory(connectionUri);
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
pooledFactory.setMaxConnections(1);
pooledFactory.setBlockIfSessionPoolIsFull(false);
pooledFactory.setUseAnonymousProducers(false);
}
示例3: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setUseJmx(true);
brokerService.getManagementContext().setCreateConnector(false);
brokerService.setAdvisorySupport(false);
brokerService.setSchedulerSupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
connectionUri = connector.getPublishableConnectString();
factory = new ActiveMQConnectionFactory(connectionUri);
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
pooledFactory.setMaxConnections(1);
pooledFactory.setBlockIfSessionPoolIsFull(false);
}
示例4: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setPersistent(false);
brokerService.setUseJmx(false);
brokerService.setSchedulerSupport(false);
brokerService.setAdvisorySupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
connectionUri = connector.getPublishableConnectString();
factory = new ActiveMQConnectionFactory(connectionUri);
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
pooledFactory.setMaxConnections(1);
pooledFactory.setBlockIfSessionPoolIsFull(true);
pooledFactory.setBlockIfSessionPoolIsFullTimeout(500);
pooledFactory.setMaximumActiveSessionPerConnection(1);
}
示例5: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setUseJmx(false);
brokerService.setPersistent(false);
brokerService.setSchedulerSupport(false);
brokerService.setAdvisorySupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri() + "?closeAsync=false");
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
}
開發者ID:messaginghub,項目名稱:pooled-jms,代碼行數:17,代碼來源:PooledConnectionFactoryWithTemporaryDestinationsTest.java
示例6: setUp
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
@Before
public void setUp() throws Exception {
super.setUp();
brokerService = new BrokerService();
brokerService.setUseJmx(false);
brokerService.setPersistent(false);
brokerService.setSchedulerSupport(false);
brokerService.setAdvisorySupport(false);
TransportConnector connector = brokerService.addConnector("tcp://localhost:0");
brokerService.start();
factory = new ActiveMQConnectionFactory("mock:" + connector.getConnectUri());
pooledFactory = new JmsPoolConnectionFactory();
pooledFactory.setConnectionFactory(factory);
pooledFactory.setMaxConnections(1);
}
示例7: configureBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected void configureBroker(BrokerService broker) throws Exception {
broker.setUseJmx(true);
broker.setPersistent(true);
broker.setDataDirectory("target/activemq-data");
broker.deleteAllMessages();
broker.setAdvisorySupport(true);
broker.addConnector(brokerUri);
// configure expiration rate
ActiveMQQueue queueName = new ActiveMQQueue(">");
PolicyEntry entry = new PolicyEntry();
entry.setDestination(queueName);
entry.setExpireMessagesPeriod(1000);
PolicyMap policyMap = new PolicyMap();
policyMap.put(queueName, entry);
broker.setDestinationPolicy(policyMap);
}
示例8: createBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected BrokerService createBroker(String name, boolean deleteMessagesOnStartup,
Map<String, Integer> portMap) throws Exception {
BrokerService brokerService = new BrokerService();
brokerService.setBrokerName(name);
brokerService.setDeleteAllMessagesOnStartup(deleteMessagesOnStartup);
brokerService.setUseJmx(true);
brokerService.getManagementContext().setCreateConnector(false);
brokerService.setDataDirectory(DATA_PARENT_DIR + File.separator + "data" + File.separator + name);
brokerService.setPersistent(false);
brokerService.setSchedulerSupport(false);
brokerService.setAdvisorySupport(false);
ArrayList<BrokerPlugin> plugins = new ArrayList<BrokerPlugin>();
BrokerPlugin authenticationPlugin = configureAuthentication();
if (authenticationPlugin != null) {
plugins.add(authenticationPlugin);
}
if (!plugins.isEmpty()) {
brokerService.setPlugins(plugins.toArray(new BrokerPlugin[0]));
}
addAdditionalConnectors(brokerService, portMap);
return brokerService;
}
示例9: configureBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected void configureBroker(BrokerService answer) throws Exception {
File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
KahaDBPersistenceAdapter kaha = new KahaDBPersistenceAdapter();
kaha.setDirectory(dataFileDir);
//answer.setUseJmx(false);
// The setEnableJournalDiskSyncs(false) setting is a little dangerous right now, as I have not verified
// what happens if the index is updated but a journal update is lost.
// Index is going to be in consistent, but can it be repaired?
//kaha.setEnableJournalDiskSyncs(false);
// Using a bigger journal file size makes he take fewer spikes as it is not switching files as often.
//kaha.setJournalMaxFileLength(1024*100);
// small batch means more frequent and smaller writes
//kaha.setIndexWriteBatchSize(100);
// do the index write in a separate thread
//kaha.setEnableIndexWriteAsync(true);
answer.setPersistenceAdapter(kaha);
answer.setAdvisorySupport(false);
answer.setEnableStatistics(false);
answer.addConnector(bindAddress);
answer.setDeleteAllMessagesOnStartup(true);
}
示例10: createBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected BrokerService createBroker() throws Exception {
BrokerService service = new BrokerService();
service.setAdvisorySupport(false);
service.setPersistent(false);
service.setUseJmx(true);
PolicyMap policyMap = new PolicyMap();
PolicyEntry policy = new PolicyEntry();
policy.setUseConsumerPriority(consumerPriority);
policy.setMessageGroupMapFactoryType("cached?cacheSize=" + (numConsumers - 1));
policyMap.setDefaultEntry(policy);
service.setDestinationPolicy(policyMap);
connector = service.addConnector("tcp://localhost:0");
return service;
}
示例11: configureBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
private BrokerService configureBroker(String brokerName) throws Exception {
BrokerService broker = new BrokerService();
broker.setBrokerName(brokerName);
broker.setAdvisorySupport(false);
broker.setPersistent(false);
broker.setUseJmx(false);
broker.setSchedulePeriodForDestinationPurge(1000);
broker.setAllowTempAutoCreationOnSend(true);
PolicyMap map = new PolicyMap();
PolicyEntry tempReplyQPolicy = new PolicyEntry();
tempReplyQPolicy.setOptimizedDispatch(true);
tempReplyQPolicy.setGcInactiveDestinations(true);
tempReplyQPolicy.setGcWithNetworkConsumers(true);
tempReplyQPolicy.setInactiveTimeoutBeforeGC(1000);
map.put(replyQWildcard, tempReplyQPolicy);
broker.setDestinationPolicy(map);
broker.addConnector("tcp://localhost:0");
brokers.add(broker);
return broker;
}
示例12: startBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Before
public void startBroker() throws Exception {
exceptions.clear();
for (int i = 0; i < MAX_MESSAGES; i++) {
dupChecker[i] = 0;
}
broker = new BrokerService();
broker.setAdvisorySupport(false);
broker.setPersistenceAdapter(new JDBCPersistenceAdapter());
PolicyEntry policyEntry = new PolicyEntry();
policyEntry.setMaxAuditDepth(3000);
policyEntry.setMaxPageSize(150);
policyEntry.setPrioritizedMessages(true);
PolicyMap policyMap = new PolicyMap();
policyMap.setDefaultEntry(policyEntry);
broker.setDestinationPolicy(policyMap);
broker.addConnector("tcp://localhost:0");
broker.setDeleteAllMessagesOnStartup(true);
broker.start();
broker.waitUntilStarted();
url = broker.getTransportConnectors().get(0).getConnectUri().toString() + "?" + urlOptions;
}
示例13: createBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected BrokerService createBroker() throws Exception {
BrokerService brokerService = new BrokerService();
brokerService.setDeleteAllMessagesOnStartup(true);
brokerService.setPersistent(false);
brokerService.setUseJmx(false);
brokerService.setAdvisorySupport(false);
brokerService.setSchedulerSupport(false);
connectionURI = brokerService.addConnector("amqp://localhost:0").getPublishableConnectString();
brokerService.start();
brokerService.waitUntilStarted();
return brokerService;
}
示例14: configureBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
protected void configureBroker(BrokerService brokerService) throws Exception {
brokerService.setBrokerName("testbroker1");
brokerService.setUseJmx(false);
brokerService.setPersistent(false);
brokerService.setAdvisorySupport(false);
brokerService.setSchedulerSupport(false);
TransportConnector connector = new TransportConnector();
connector.setUri(new URI("tcp://localhost:0"));
connector.setName(testName.getMethodName());
brokerService.addConnector(connector);
}
示例15: createBroker
import org.apache.activemq.broker.BrokerService; //導入方法依賴的package包/類
@Override
protected String createBroker() throws Exception {
brokerService = new BrokerService();
brokerService.setBrokerName("PooledConnectionSessionCleanupTestBroker");
brokerService.setUseJmx(true);
brokerService.getManagementContext().setCreateConnector(false);
brokerService.setPersistent(false);
brokerService.setSchedulerSupport(false);
brokerService.setAdvisorySupport(false);
TransportConnector connector = brokerService.addConnector("tcp://0.0.0.0:61626");
brokerService.start();
brokerService.waitUntilStarted();
return "failover:(" + connector.getPublishableConnectString() + ")?maxReconnectAttempts=5";
}