本文整理汇总了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";
}