use of org.apache.activemq.util.ByteSequence in project activemq-artemis by apache.
the class OpenWireConnection method physicalSend.
public void physicalSend(Command command) throws IOException {
if (logger.isTraceEnabled()) {
tracePhysicalSend(transportConnection, command);
}
try {
final ByteSequence bytes = outWireFormat.marshal(command);
final int bufferSize = bytes.length;
final ActiveMQBuffer buffer = transportConnection.createTransportBuffer(bufferSize);
buffer.writeBytes(bytes.data, bytes.offset, bufferSize);
transportConnection.write(buffer, false, false);
bufferSent();
} catch (IOException e) {
throw e;
} catch (Throwable t) {
ActiveMQServerLogger.LOGGER.error("error sending", t);
}
}
use of org.apache.activemq.util.ByteSequence in project activemq-artemis by apache.
the class OpenWireMessageConverter method putMsgOriginalDestination.
private static void putMsgOriginalDestination(final ActiveMQDestination origDest, final WireFormat marshaller, final CoreMessage coreMessage) throws IOException {
final ByteSequence origDestBytes = marshaller.marshal(origDest);
origDestBytes.compact();
coreMessage.putBytesProperty(AMQ_MSG_ORIG_DESTINATION, origDestBytes.data);
}
use of org.apache.activemq.util.ByteSequence in project activemq-artemis by apache.
the class OpenWireMessageConverter method setAMQMsgOriginalTransactionId.
private static void setAMQMsgOriginalTransactionId(final ActiveMQMessage amqMsg, final WireFormat marshaller, final byte[] origTxIdBytes) throws IOException {
TransactionId origTxId = (TransactionId) marshaller.unmarshal(new ByteSequence(origTxIdBytes));
amqMsg.setOriginalTransactionId(origTxId);
}
use of org.apache.activemq.util.ByteSequence in project activemq-artemis by apache.
the class OpenWireMessageConverter method setAMQMsgDataStructure.
private static void setAMQMsgDataStructure(final ActiveMQMessage amqMsg, final WireFormat marshaller, final byte[] dsBytes) throws IOException {
ByteSequence seq = new ByteSequence(dsBytes);
DataStructure ds = (DataStructure) marshaller.unmarshal(seq);
amqMsg.setDataStructure(ds);
}
use of org.apache.activemq.util.ByteSequence in project activemq-artemis by apache.
the class OpenWireMessageConverter method putMsgReplyTo.
private static void putMsgReplyTo(final ActiveMQDestination replyTo, final WireFormat marshaller, final CoreMessage coreMessage) throws IOException {
final ByteSequence replyToBytes = marshaller.marshal(replyTo);
replyToBytes.compact();
coreMessage.putBytesProperty(AMQ_MSG_REPLY_TO, replyToBytes.data);
}
Aggregations