Package org.apache.activemq

Examples of org.apache.activemq.ActiveMQConnectionFactory


    session.close();
    connection.close();
  }

  private void putTopic(List<String> events) throws Exception {
    ConnectionFactory factory = new ActiveMQConnectionFactory(USERNAME,
        PASSWORD, BROKER_BIND_URL);
    Connection connection = factory.createConnection();
    connection.start();

    Session session = connection.createSession(true,
        Session.AUTO_ACKNOWLEDGE);
    Destination destination = session.createTopic(DESTINATION_NAME);
View Full Code Here


    /*
     * Adds a local in memory JMS component for the test
     */
    private void addTestJmsComponent() {
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://test?broker.persistent=false");
        JmsConfiguration jmsConfig = new JmsConfiguration(connectionFactory);
        JmsComponent component = new JmsComponent(jmsConfig);
        context.addComponent("jms", component);
    }
View Full Code Here

        System.in.read();
        context.stop();
    }

    private void addJmsComponent(CamelContext context) {
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("tcp://localhost:61616");
        JmsConfiguration jmsConfig = new JmsConfiguration(cf);
        context.addComponent("jms", new JmsComponent(jmsConfig));
    }
View Full Code Here

public class JmsServiceTest extends Assert {

    private static final String TEST_QUEUE_NAME = "test";
   
    private Connection createAndStartConnection() throws JMSException {
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://test?broker.persistent=false");
        Connection con = cf.createConnection();
        con.start();
        return con;
    }
View Full Code Here

public class Jms2RestStarter {

   
    public void run() throws Exception {
        CamelContext context = new DefaultCamelContext();
        JmsConfiguration jmsConfig = new JmsConfiguration(new ActiveMQConnectionFactory("tcp://localhost:61616"));
        context.addComponent("jms", new JmsComponent(jmsConfig ));
        context.setTracing(true);
        context.addRoutes(new Jms2RestRoute());
        context.start();
        System.in.read();
View Full Code Here

    private boolean createTemporaryDestination;

    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUri);
        SjmsComponent component = new SjmsComponent();
        component.setConnectionFactory(connectionFactory);
        component.setDestinationCreationStrategy(new TestDestinationCreationStrategyTest());
        camelContext.addComponent("sjms", component);
        return camelContext;
View Full Code Here

public class ConnectionFactoryResourceTest {
    private ActiveMQConnectionFactory connectionFactory;

    @Before
    public void setup() {
        connectionFactory = new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useJmx=false");
    }
View Full Code Here

    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();

        camelContext.addComponent("async", new MyAsyncComponent());

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(
                "vm://broker?broker.persistent=false&broker.useJmx=false");
        SjmsComponent component = new SjmsComponent();
        component.setConnectionFactory(connectionFactory);
        camelContext.addComponent("sjms", component);
View Full Code Here

     * @throws Exception
     */
    @Override
    protected CamelContext createCamelContext() throws Exception {
        CamelContext camelContext = super.createCamelContext();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUri);
        connection = connectionFactory.createConnection();
        connection.start();
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        SjmsComponent component = new SjmsComponent();
        component.setConnectionCount(1);
        component.setConnectionFactory(connectionFactory);
View Full Code Here

      amqBroker.addConnector("stomp://" + hostName + ":" + portNumber);
      amqBroker.start();
    } catch(Exception e) {
      System.err.println("Cannot broker messages: " + e);
    }
    ActiveMQConnectionFactory connectionFactory=new ActiveMQConnectionFactory("vm://localhost");

    Connection connection=connectionFactory.createConnection();
    connection.start();
    Session session=connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

    Destination destination=session.createQueue("noit.firehose");
    consumer = session.createConsumer(destination);
View Full Code Here

TOP

Related Classes of org.apache.activemq.ActiveMQConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.