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;
}
Aggregations