Package org.apache.qpid.server.queue

Examples of org.apache.qpid.server.queue.MessageHandleFactory


        }
    }

    private static AMQMessageHandle createMessageHandle(final long messageId, final MessagePublishInfo publishBody)
    {
        final AMQMessageHandle amqMessageHandle = (new MessageHandleFactory()).createMessageHandle(messageId,
                                                                                                   null,
                                                                                                   false);
        try
        {
            amqMessageHandle.setPublishAndContentHeaderBody(new StoreContext(),
View Full Code Here


            fail(e.getMessage());
        }

        try
        {
            currentMessage.routingComplete(_virtualHost.getMessageStore(), new MessageHandleFactory());
        }
        catch (AMQException e)
        {
            fail(e.getMessage());
        }
View Full Code Here

            {
                conn = newConnection();
            }


            MessageHandleFactory messageHandleFactory = new MessageHandleFactory();
            long maxId = 1;

            TransactionalContext txnContext = new NonTransactionalContext(this, new StoreContext(), null, null);

            Statement stmt = conn.createStatement();
View Full Code Here

            fail(e.getMessage());
        }

        try
        {
            currentMessage.routingComplete(_virtualHost.getMessageStore(), new MessageHandleFactory());
        }
        catch (AMQException e)
        {
            fail(e.getMessage());
        }
View Full Code Here

        AMQMessage message = createMessage("a.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has  route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has no route and should fail to be routed");
        }
        catch (AMQException nre)
        {
        }
View Full Code Here

        AMQMessage message = createMessage("a.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has  route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has no route and should fail to be routed");
        }
        catch (AMQException nre)
        {
        }
View Full Code Here

        AMQMessage message = createMessage("a.b.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());

        message = createMessage("a");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has no route and should fail to be routed");
        }
        catch (AMQException nre)
        {
        }
View Full Code Here

        AMQMessage message = createMessage("a.c.d.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has no route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());

        message = createMessage("a.c.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has no route and should be routed");
        }
View Full Code Here

        AMQMessage message = createMessage("a.c.b.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has route and should not be routed");
        }
        catch (AMQException nre)
        {
        }

        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.a.b.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has no route and should be routed");
        }

        Assert.assertEquals(1, queue.getMessageCount());

        Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));

        queue.deleteMessageFromTop(_context);
        Assert.assertEquals(0, queue.getMessageCount());

        message = createMessage("a.b.c.b");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has  route and should not be routed");
        }
        catch (AMQException nre)
        {
        }

        Assert.assertEquals(0, queue.getMessageCount());

        message = createMessage("a.b.c.b.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has no route and should be routed");
View Full Code Here

        AMQMessage message = createMessage("a.c.b.b.c");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
            fail("Message has route and should not be routed");
        }
        catch (AMQException nre)
        {
        }

        Assert.assertEquals(0, queue.getMessageCount());


        message = createMessage("a.a.b.c.d");

        try
        {
            _exchange.route(message);
            message.routingComplete(_store, _context, new MessageHandleFactory());
        }
        catch (AMQException nre)
        {
            fail("Message has no route and should be routed");
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.queue.MessageHandleFactory

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.