Examples of createQueue()


Examples of javax.jms.Session.createQueue()

    public void testClientCreateNamedQueueFailure() throws NamingException, JMSException, AMQException, Exception
    {
        Connection conn = getConnection("test", "client", "guest");
        Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
        conn.start();
        Destination dest = sess.createQueue("IllegalQueue");

        try
        {
            //Create a Named Queue as side effect
            sess.createConsumer(dest);
View Full Code Here

Examples of javax.jms.Session.createQueue()

        Queue nonDurableQueue = (Queue) session.createQueue("direct://amq.direct/" + testQueueName + "/" + testQueueName
                + "?durable='false'");

        ((AMQSession<?,?>)session).declareAndBind((AMQDestination)nonDurableQueue);

        Queue durableQueue = (Queue) session.createQueue("direct://amq.direct/" + testQueueName + "/" + testQueueName
                + "?durable='true'");
        try
        {
            ((AMQSession<?,?>)session).declareAndBind((AMQDestination) durableQueue);
            fail("Exception not thrown");
View Full Code Here

Examples of javax.jms.Session.createQueue()

        Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);

        conn.start();

        Queue queue = sess.createQueue("example.RequestQueue");

        ((AMQSession<?,?>)sess).declareAndBind((AMQDestination)queue);

        MessageProducer sender = sess.createProducer(queue);
View Full Code Here

Examples of javax.jms.Session.createQueue()

    public void testRequestResponseSuccess() throws Exception
    {
        //Set up the Server
        Connection serverConnection = getConnection("test", "server", "guest");
        Session serverSession = serverConnection.createSession(true, Session.SESSION_TRANSACTED);
        Queue requestQueue = serverSession.createQueue("example.RequestQueue");
        MessageConsumer server = serverSession.createConsumer(requestQueue);
        serverConnection.start();

        //Set up the consumer
        Connection clientConnection = getConnection("test", "client", "guest");
View Full Code Here

Examples of javax.jms.Session.createQueue()

                e.printStackTrace();
            }
        });
        // Create a session on the connection, transacted to confirm delivery
        Session session = connection.createSession(true, Session.SESSION_TRANSACTED);
        Queue queue = session.createQueue(QUEUE_NAME);
        // Create a consumer to ensure the queue gets created
        // (and enter it into the store, as queues are made durable by default)
        MessageConsumer messageConsumer = session.createConsumer(queue);
        messageConsumer.close();
View Full Code Here

Examples of javax.jms.Session.createQueue()

        queueWithDLQArguments.put("x-qpid-dlq-enabled", true);
        queueWithDLQArguments.put("x-qpid-maximum-delivery-count", 2);
        createAndBindQueueOnBroker(session, QUEUE_WITH_DLQ_NAME, queueWithDLQArguments);

        // Send message to the DLQ
        Queue dlq = session.createQueue("fanout://" + QUEUE_WITH_DLQ_NAME + "_DLE//does-not-matter");
        MessageProducer dlqMessageProducer = session.createProducer(dlq);
        sendMessages(session, dlqMessageProducer, dlq, DeliveryMode.PERSISTENT, 1*1024, 1);
        session.commit();

        // Create a queue with JMX specifying an owner, so it can later be moved into description
View Full Code Here

Examples of javax.jms.Session.createQueue()

                consumer = session.createConsumer(destination);
            }
        }
        else
        {
            destination = session.createQueue(getTestQueueName());
            consumer = session.createConsumer(destination);
        }
        consumer.close();
    }
View Full Code Here

Examples of javax.jms.Session.createQueue()

    Connection connection = factory.createConnection();
    connection.start();

    Session session = connection.createSession(true,
        Session.AUTO_ACKNOWLEDGE);
    Destination destination = session.createQueue(DESTINATION_NAME);
    MessageProducer producer = session.createProducer(destination);


    for(String event : events) {
      TextMessage message = session.createTextMessage();
View Full Code Here

Examples of javax.jms.Session.createQueue()

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

    Destination destination=session.createQueue("noit.firehose");
    consumer = session.createConsumer(destination);
  }
 
  public void consume(IEventHandler eh) {
    while (true) {
View Full Code Here

Examples of javax.jms.Session.createQueue()

            // Create the session
            Session session = connection.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
            if (topic) {
                destination = session.createTopic(subject);
            } else {
                destination = session.createQueue(subject);
            }

            // Create the producer.
            MessageProducer producer = session.createProducer(destination);
            if (persistent) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.