Examples of AMQSession


Examples of org.apache.qpid.client.AMQSession

        return _methodDispatcher;
    }

    public void setTicket(int ticket, int channelId)
    {
        final AMQSession session = getSession(channelId);
        session.setTicket(ticket);
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

        _methodDispatcher = methodDispatcher;
    }

    public void setFlowControl(final int channelId, final boolean active)
    {
        final AMQSession session = getSession(channelId);
        session.setFlowControl(active);
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

    public void test() throws Exception
    {

        AMQConnection connection = (AMQConnection) getConnection();

        AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // Set no wait true so that we block the connection
        // Also set a different exchange class string so the attempt to declare
        // the exchange causes an exchange.
        ExchangeDeclareBody body = session.getMethodRegistry().createExchangeDeclareBody(session.getTicket(), new AMQShortString(EXCHANGE_NAME), null,
                                                                                         true, false, false, false, true, null);

        AMQFrame exchangeDeclare = body.generateFrame(session.getChannelId());

        try
        {
            // block our thread so that can times out
            connection.getProtocolHandler().syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

                }

                //Test queue is still there.
                AMQConnection connection = new AMQConnection(_brokerDetails, _username, _password, "DifferentClientID", _virtualpath);

                AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

                try
                {
                    session.createConsumer(session.createQueue(QUEUE));
                    _logger.error("Create consumer succeeded." +
                                  " This shouldn't be allowed as this means the queue didn't exist when it should");

                    connection.close();
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

            System.err.println(url.toString());
            conn = new AMQConnection(url);


            AMQSession sess = (AMQSession) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

            sess.declareExchange(new AMQShortString("test.direct"),
                    AMQShortString.valueOf(ExchangeDefaults.DIRECT_EXCHANGE_CLASS), false);

            sess.declareExchange(new AMQShortString("tmp.direct"),
                    AMQShortString.valueOf(ExchangeDefaults.DIRECT_EXCHANGE_CLASS), false);

            sess.declareExchange(new AMQShortString("tmp.topic"),
                    AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_CLASS), false);

            sess.declareExchange(new AMQShortString("test.topic"),
                    AMQShortString.valueOf(ExchangeDefaults.TOPIC_EXCHANGE_CLASS), false);

            QueueSession queueSession = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

            AMQQueue queue = (AMQQueue) queueSession.createQueue("MyQueue");
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

     * @param channelId the channel id the message should be delivered to
     * @param msg       the message
     */
    private void deliverMessageToAMQSession(int channelId, UnprocessedMessage msg)
    {
        AMQSession session = getSession(channelId);
        session.messageReceived(msg);
        if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
        {
            _channelId2UnprocessedMsgArray[channelId] = null;
        }
        else
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

    {

        // if this is not a response to an earlier request to close the channel
        if (_closingChannels.remove(channelId) == null)
        {
            final AMQSession session = getSession(channelId);
            try
            {
                session.closed(new AMQException(code, text, null));
            }
            catch (JMSException e)
            {
                throw new AMQException(null, "JMSException received while closing session", e);
            }
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

        return new AMQShortString(queueName.replaceAll("_+", "_"));
    }

    public void confirmConsumerCancelled(int channelId, AMQShortString consumerTag)
    {
        final AMQSession session = getSession(channelId);

        session.confirmConsumerCancelled(consumerTag.toIntValue());
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

        return _methodDispatcher;
    }

    public void setTicket(int ticket, int channelId)
    {
        final AMQSession session = getSession(channelId);
        session.setTicket(ticket);
    }
View Full Code Here

Examples of org.apache.qpid.client.AMQSession

        _methodDispatcher = methodDispatcher;
    }

    public void setFlowControl(final int channelId, final boolean active)
    {
        final AMQSession session = getSession(channelId);
        session.setFlowControl(active);
    }
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.