mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-21 17:46:48 +00:00
This closes #1068
This commit is contained in:
commit
5316a80484
@ -514,7 +514,7 @@ public class CoreMessage extends RefCountMessage implements ICoreMessage {
|
||||
// so we always need to take the BUFFER_HEADER_SPACE from packet impl into consideration
|
||||
endOfBodyPosition = writableBuffer.writerIndex() + BUFFER_HEADER_SPACE - 4;
|
||||
} else if (endOfBodyPosition <= 0) {
|
||||
endOfBodyPosition = BUFFER_HEADER_SPACE;
|
||||
endOfBodyPosition = BUFFER_HEADER_SPACE + DataConstants.SIZE_INT;
|
||||
}
|
||||
|
||||
buffer.setIndex(0, 0);
|
||||
|
@ -197,7 +197,7 @@ public class CoreMessageTest {
|
||||
empty2.receiveBuffer(buffer);
|
||||
|
||||
try {
|
||||
empty2.getBodyBuffer().readByte();
|
||||
empty2.getBodyBuffer().readLong();
|
||||
Assert.fail("should throw exception");
|
||||
} catch (Exception expected) {
|
||||
|
||||
|
@ -17,12 +17,15 @@
|
||||
package org.apache.activemq.artemis.jms.example;
|
||||
|
||||
import org.apache.activemq.artemis.api.core.Message;
|
||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
||||
import org.apache.activemq.artemis.core.server.cluster.Transformer;
|
||||
|
||||
public class AddForwardingTimeTransformer implements Transformer {
|
||||
|
||||
@Override
|
||||
public Message transform(final Message message) {
|
||||
message.putLongProperty(new SimpleString("time_of_forward"), System.currentTimeMillis());
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
@ -190,6 +190,8 @@ public class ConsumerTest extends ActiveMQTestBase {
|
||||
|
||||
Assert.assertEquals("hi", message2.getReadOnlyBodyBuffer().readString());
|
||||
|
||||
Assert.assertNull(consumer.receiveImmediate());
|
||||
|
||||
session.close();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user