@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final TransportConfiguration... transportConfigurations) { return new ActiveMQJMSConnectionFactory(false, transportConfigurations); }
private Connection createCoreConnection(String connectionString, String username, String password, String clientId, boolean start) throws JMSException { ActiveMQJMSConnectionFactory factory = new ActiveMQJMSConnectionFactory(connectionString); Connection connection = trackJMSConnection(factory.createConnection(username, password)); connection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) { exception.printStackTrace(); } }); if (clientId != null && !clientId.isEmpty()) { connection.setClientID(clientId); } if (start) { connection.start(); } return connection; }
public static Connection createConnection(final String connectorFactory) throws JMSException { ActiveMQJMSConnectionFactory cf = (ActiveMQJMSConnectionFactory) ActiveMQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, new TransportConfiguration(connectorFactory)); cf.setBlockOnNonDurableSend(true); cf.setBlockOnDurableSend(true); cf.setBlockOnAcknowledge(true); return cf.createConnection(); }
protected final Connection createConnection() throws JMSException { Connection c = cf.createConnection(); return addConnection(c); }
protected final TopicConnection createTopicConnection() throws JMSException { TopicConnection c = cf.createTopicConnection(); addConnection(c); return c; }
protected final QueueConnection createQueueConnection() throws JMSException { QueueConnection c = cf.createQueueConnection(); addConnection(c); return c; }
protected final JMSContext createContext() { return addContext(cf.createContext()); }
@Override @After public void tearDown() throws Exception { super.tearDown(); if (cf != null) { cf.close(); } cf = null; assertRemainingMessages(0); }
protected final Connection createConnection(String user, String password) throws JMSException { Connection c = cf.createConnection(user, password); addConnection(c); return c; }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithHA(final DiscoveryGroupConfiguration groupConfiguration) { return new ActiveMQJMSConnectionFactory(true, groupConfiguration); }
Connection conn = cf.createConnection(); conn.setClientID("tst"); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) { return new ActiveMQJMSConnectionFactory(false, groupConfiguration); }
conn = cf.createConnection(); conn.setClientID("tst"); Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
@Override public ActiveMQConnectionFactory createConnectionFactoryWithHA(final TransportConfiguration... initialServers) { return new ActiveMQJMSConnectionFactory(true, initialServers); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithHA(final TransportConfiguration... initialServers) { return new ActiveMQJMSConnectionFactory(true, initialServers); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) { return new ActiveMQJMSConnectionFactory(false, groupConfiguration); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) { return new ActiveMQJMSConnectionFactory(false, groupConfiguration); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithHA(final TransportConfiguration... initialServers) { return new ActiveMQJMSConnectionFactory(true, initialServers); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final TransportConfiguration... transportConfigurations) { return new ActiveMQJMSConnectionFactory(false, transportConfigurations); }
@Override public ActiveMQConnectionFactory createConnectionFactoryWithoutHA(final DiscoveryGroupConfiguration groupConfiguration) { return new ActiveMQJMSConnectionFactory(false, groupConfiguration); }