Package org.apache.qpid.framing

Examples of org.apache.qpid.framing.ContentHeaderBody


            stmt.setString(2, mmd.getMessagePublishInfo().getExchange().toString());
            stmt.setString(3, mmd.getMessagePublishInfo().getRoutingKey().toString());
            stmt.setShort(4, mmd.getMessagePublishInfo().isMandatory() ? (short) 1 : (short) 0);
            stmt.setShort(5, mmd.getMessagePublishInfo().isImmediate() ? (short) 1 : (short) 0);

            ContentHeaderBody headerBody = mmd.getContentHeaderBody();
            final int bodySize = headerBody.getSize();
            byte[] underlying = new byte[bodySize];
            ByteBuffer buf = ByteBuffer.wrap(underlying);
            headerBody.writePayload(buf);
/*
            Blob dataAsBlob = conn.createBlob();
            dataAsBlob.setBytes(1L, underlying);
            stmt.setBlob(6, dataAsBlob);
*/
 
View Full Code Here


                Blob dataAsBlob = rs.getBlob(5);

                byte[] dataAsBytes = dataAsBlob.getBytes(1,(int) dataAsBlob.length());
                ByteBuffer buf = ByteBuffer.wrap(dataAsBytes);

                ContentHeaderBody chb = ContentHeaderBody.createFromBuffer(buf, dataAsBytes.length);

                if(localTx)
                {
                    commitTran(context);
                }
View Full Code Here

        for (int count = 0; count < messages; count++)
        {
            channel.setPublishFrame(info,  _virtualHost.getExchangeRegistry().getExchange(info.getExchange()));

            //Set the body size
            ContentHeaderBody _headerBody = new ContentHeaderBody();
            _headerBody.bodySize = 0;

            //Set Minimum properties
            BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
View Full Code Here

        {
            // Create the tabular list of message header contents
            for (int i = beginIndex; (i <= endIndex) && (i <= list.size()); i++)
            {
                AMQMessage msg = list.get(i - 1).getMessage();
                ContentHeaderBody headerBody = msg.getContentHeaderBody();
                // Create header attributes list
                String[] headerAttributes = getMessageHeaderProperties(headerBody);
                Object[] itemValues = { msg.getMessageId(), headerAttributes, headerBody.bodySize, msg.isRedelivered() };
                CompositeData messageData = new CompositeDataSupport(_messageDataType, _msgAttributeNames, itemValues);
                _messageList.put(messageData);
View Full Code Here

    public void testEnqueueDequeueOfPersistentMessageToNonDurableQueue() throws AMQException
    {
        // Create IncomingMessage and nondurable queue
        final IncomingMessage msg = new IncomingMessage(info);
        ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
        contentHeaderBody.setProperties(new BasicContentHeaderProperties());
        ((BasicContentHeaderProperties) contentHeaderBody.getProperties()).setDeliveryMode((byte) 2);
        msg.setContentHeaderBody(contentHeaderBody);

        final ArrayList<BaseQueue> qs = new ArrayList<BaseQueue>();

        // Send persistent message
View Full Code Here

        for (int count = 0; count < messages; count++)
        {
            channel.setPublishFrame(info, _virtualHost.getExchangeRegistry().getExchange(info.getExchange()));

            //Set the body size
            ContentHeaderBody _headerBody = new ContentHeaderBody();
            _headerBody.bodySize = 0;

            //Set Minimum properties
            BasicContentHeaderProperties properties = new BasicContentHeaderProperties();

            properties.setExpiration(0L);
            properties.setTimestamp(System.currentTimeMillis());

            //Make Message Persistent
            properties.setDeliveryMode((byte) 2);

            _headerBody.setProperties(properties);

            channel.publishContentHeader(_headerBody);
        }

    }
View Full Code Here

        private int _count;

        TestMessage(long tag, long messageId, MessagePublishInfo publishBody)
                throws AMQException
        {
            this(tag, messageId, publishBody, new ContentHeaderBody(1, 1, new BasicContentHeaderProperties(), 0));

        }
View Full Code Here

        currentMessage = new IncomingMessage(messageInfo);

        currentMessage.setExchange(exchange);

        ContentHeaderBody headerBody = new ContentHeaderBody();
        headerBody.classId = BasicConsumeBodyImpl.CLASS_ID;
        headerBody.bodySize = 0;

        headerBody.setProperties(properties);

        try
        {
            currentMessage.setContentHeaderBody(headerBody);
        }
View Full Code Here

        return new MessagePublishInfoImpl(null, false, false, new AMQShortString(id));
    }

    static ContentHeaderBody getContentHeader(FieldTable headers)
    {
        ContentHeaderBody header = new ContentHeaderBody();
        header.setProperties(getProperties(headers));
        return header;
    }
View Full Code Here

            {
                return null;
            }
        };

        ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
        contentHeaderBody.bodySize = MESSAGE_SIZE;   // in bytes
        contentHeaderBody.setProperties(new BasicContentHeaderProperties());
        ((BasicContentHeaderProperties) contentHeaderBody.getProperties()).setDeliveryMode((byte) (persistent ? 2 : 1));
        IncomingMessage msg = new IncomingMessage(publish);
        msg.setContentHeaderBody(contentHeaderBody);
        return msg;

    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.framing.ContentHeaderBody

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.