Search in sources :

Example 56 with AMQPMessage

use of org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage in project activemq-artemis by apache.

the class JMSTransformationSpeedComparisonTest method testTypicalQpidJMSMessage.

@Test
public void testTypicalQpidJMSMessage() throws Exception {
    AMQPMessage encoded = new AMQPMessage(createTypicalQpidJMSMessage());
    // Warm up
    for (int i = 0; i < WARM_CYCLES; ++i) {
        ICoreMessage intermediate = encoded.toCore();
        encode(AMQPConverter.getInstance().fromCore(intermediate));
    }
    long totalDuration = 0;
    long startTime = System.nanoTime();
    for (int i = 0; i < PROFILE_CYCLES; ++i) {
        ICoreMessage intermediate = encoded.toCore();
        encode(AMQPConverter.getInstance().fromCore(intermediate));
    }
    totalDuration += System.nanoTime() - startTime;
    LOG_RESULTS(totalDuration);
}
Also used : ICoreMessage(org.apache.activemq.artemis.api.core.ICoreMessage) AMQPMessage(org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage) Test(org.junit.Test)

Example 57 with AMQPMessage

use of org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage in project activemq-artemis by apache.

the class JMSTransformationSpeedComparisonTest method testTypicalQpidJMSMessageInBoundOnly.

@Test
public void testTypicalQpidJMSMessageInBoundOnly() throws Exception {
    AMQPMessage encoded = encode(createTypicalQpidJMSMessage());
    // Warm up
    for (int i = 0; i < WARM_CYCLES; ++i) {
        ICoreMessage intermediate = encoded.toCore();
        encode(AMQPConverter.getInstance().fromCore(intermediate));
    }
    long totalDuration = 0;
    long startTime = System.nanoTime();
    for (int i = 0; i < PROFILE_CYCLES; ++i) {
        ICoreMessage intermediate = encoded.toCore();
        encode(AMQPConverter.getInstance().fromCore(intermediate));
    }
    totalDuration += System.nanoTime() - startTime;
    LOG_RESULTS(totalDuration);
}
Also used : ICoreMessage(org.apache.activemq.artemis.api.core.ICoreMessage) AMQPMessage(org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage) Test(org.junit.Test)

Aggregations

AMQPMessage (org.apache.activemq.artemis.protocol.amqp.broker.AMQPMessage)57 Test (org.junit.Test)49 ICoreMessage (org.apache.activemq.artemis.api.core.ICoreMessage)35 Message (org.apache.qpid.proton.message.Message)26 MessageImpl (org.apache.qpid.proton.message.impl.MessageImpl)21 ServerJMSBytesMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSBytesMessage)20 ServerJMSMapMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMapMessage)20 ServerJMSMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSMessage)20 ServerJMSStreamMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSStreamMessage)20 ServerJMSTextMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSTextMessage)20 TextMessage (javax.jms.TextMessage)19 ServerJMSObjectMessage (org.apache.activemq.artemis.protocol.amqp.converter.jms.ServerJMSObjectMessage)19 AmqpValue (org.apache.qpid.proton.amqp.messaging.AmqpValue)19 Header (org.apache.qpid.proton.amqp.messaging.Header)11 ApplicationProperties (org.apache.qpid.proton.amqp.messaging.ApplicationProperties)10 HashMap (java.util.HashMap)9 Binary (org.apache.qpid.proton.amqp.Binary)9 Data (org.apache.qpid.proton.amqp.messaging.Data)6 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)5 ByteBuf (io.netty.buffer.ByteBuf)4