use of org.apache.activemq.ActiveMQConnectionFactory in project ignite by apache.
the class IgniteJmsStreamerTest method beforeTest.
/**
* @throws Exception If failed.
*/
@Before
@SuppressWarnings("unchecked")
public void beforeTest() throws Exception {
grid().<Integer, String>getOrCreateCache(defaultCacheConfiguration());
broker = new BrokerService();
broker.setDeleteAllMessagesOnStartup(true);
broker.setPersistent(false);
broker.setPersistenceAdapter(null);
broker.setPersistenceFactory(null);
PolicyMap plcMap = new PolicyMap();
PolicyEntry plc = new PolicyEntry();
plc.setQueuePrefetch(1);
broker.setDestinationPolicy(plcMap);
broker.getDestinationPolicy().setDefaultEntry(plc);
broker.setSchedulerSupport(false);
broker.start(true);
connFactory = new ActiveMQConnectionFactory(BrokerRegistry.getInstance().findFirst().getVmConnectorURI());
}
use of org.apache.activemq.ActiveMQConnectionFactory in project tomee by apache.
the class JmsTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
// create a transaction manager
final GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
// create the ActiveMQ resource adapter instance
ra = new ActiveMQResourceAdapter();
// initialize properties
ra.setServerUrl(brokerAddress);
ra.setBrokerXmlConfig(brokerXmlConfig);
ra.setStartupTimeout(new Duration(10, TimeUnit.SECONDS));
// create a thead pool for ActiveMQ
final Executor threadPool = Executors.newFixedThreadPool(30);
// create a work manager which ActiveMQ uses to dispatch message delivery jobs
final TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(transactionManager);
final GeronimoWorkManager workManager = new GeronimoWorkManager(threadPool, threadPool, threadPool, Collections.<WorkContextHandler>singletonList(txWorkContextHandler));
// wrap the work mananger and transaction manager in a bootstrap context (connector spec thing)
final BootstrapContext bootstrapContext = new GeronimoBootstrapContext(workManager, transactionManager, transactionManager);
// Create a ConnectionFactory
connectionFactory = new ActiveMQConnectionFactory(brokerAddress);
ra.setConnectionFactory(connectionFactory);
// start the resource adapter
try {
ra.start(bootstrapContext);
} catch (final ResourceAdapterInternalException e) {
throw new OpenEJBException(e);
}
}
use of org.apache.activemq.ActiveMQConnectionFactory in project ddf by codice.
the class OpenwireProducerConsumerExample method createConnectionFactory.
private ConnectionFactory createConnectionFactory() {
ActiveMQConnectionFactory jmsConnectFactory = new ActiveMQConnectionFactory();
jmsConnectFactory.setUserName("admin");
jmsConnectFactory.setPassword("admin");
jmsConnectFactory.setBrokerURL("failover://(tcp://localhost:61616,tcp://localhost:61617)");
jmsConnectFactory.setWatchTopicAdvisories(false);
return jmsConnectFactory;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project av-service by dvoraka.
the class JmsFileCommonConfig method activeMQConnFactory.
@Bean
public ActiveMQConnectionFactory activeMQConnFactory() {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUrl);
factory.setUseAsyncSend(true);
return factory;
}
use of org.apache.activemq.ActiveMQConnectionFactory in project av-service by dvoraka.
the class JmsCommonServerConfig method serverActiveMQConnectionFactory.
@Bean
public ActiveMQConnectionFactory serverActiveMQConnectionFactory() {
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUrl);
factory.setUseAsyncSend(true);
return factory;
}
Aggregations