Package com.taobao.metamorphosis.utils.MessageUtils

Examples of com.taobao.metamorphosis.utils.MessageUtils.DecodedMessage


            while (buf.hasRemaining()) {
                channel.read(buf);
            }
            buf.flip();

            final DecodedMessage decodedMessage1 = MessageUtils.decodeMessage(this.topic, buf.array(), 0);
            final DecodedMessage decodedMessage2 =
                    MessageUtils.decodeMessage(this.topic, buf.array(), decodedMessage1.newOffset);
            final Message msg1 = new Message(this.topic, "hello".getBytes());
            MessageAccessor.setId(msg1, id1);
            final Message msg2 = new Message(this.topic, "world".getBytes());
            MessageAccessor.setId(msg2, id2);
View Full Code Here


            while (buf.hasRemaining()) {
                channel.read(buf);
            }
            buf.flip();

            final DecodedMessage decodedMessage1 = MessageUtils.decodeMessage(this.topic, buf.array(), 0);
            final DecodedMessage decodedMessage2 =
                    MessageUtils.decodeMessage(this.topic, buf.array(), decodedMessage1.newOffset);
            final Message msg1 = new Message(this.topic, "hello".getBytes());
            MessageAccessor.setId(msg1, id1);
            final Message msg2 = new Message(this.topic, "world".getBytes());
            MessageAccessor.setId(msg2, id2);
View Full Code Here

        final long msgId = 10000L;
        final String topic = "test";
        final PutCommand req = new PutCommand(topic, 1, "hello".getBytes(), null, 0, -1);
        final ByteBuffer buf = MessageUtils.makeMessageBuffer(msgId, req);

        final DecodedMessage decodedMsg = MessageUtils.decodeMessage(topic, buf.array(), 0);
        assertNotNull(decodedMsg);
        assertEquals(topic, decodedMsg.message.getTopic());
        assertNull(decodedMsg.message.getAttribute());
        assertEquals(msgId, decodedMsg.message.getId());
        assertEquals("hello", new String(decodedMsg.message.getData()));
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.utils.MessageUtils.DecodedMessage

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.