Search in sources :

Example 1 with SessionReceiveMessage_1X

use of org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage_1X in project activemq-artemis by apache.

the class CoreSessionCallback method sendMessage.

@Override
public int sendMessage(MessageReference ref, Message message, ServerConsumer consumer, int deliveryCount) {
    Packet packet;
    if (channel.getConnection().isVersionBeforeAddressChange()) {
        packet = new SessionReceiveMessage_1X(consumer.getID(), message.toCore(coreMessageObjectPools), deliveryCount);
    } else {
        packet = new SessionReceiveMessage(consumer.getID(), message.toCore(coreMessageObjectPools), deliveryCount);
    }
    int size = 0;
    if (channel.sendBatched(packet)) {
        size = packet.getPacketSize();
    }
    return size;
}
Also used : Packet(org.apache.activemq.artemis.core.protocol.core.Packet) SessionReceiveMessage_1X(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage_1X) SessionReceiveMessage(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage)

Aggregations

Packet (org.apache.activemq.artemis.core.protocol.core.Packet)1 SessionReceiveMessage (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage)1 SessionReceiveMessage_1X (org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionReceiveMessage_1X)1