本文整理了Java中org.apache.activemq.artemis.api.core.Message.isLargeMessage()
方法的一些代码示例,展示了Message.isLargeMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.isLargeMessage()
方法的具体详情如下:
包路径:org.apache.activemq.artemis.api.core.Message
类名称:Message
方法名:isLargeMessage
暂无
代码示例来源:origin: apache/activemq-artemis
private void initializeIsLargeMessage() {
assert largeMessage == UNDEFINED_IS_LARGE_MESSAGE && message != null;
largeMessage = getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE;
}
代码示例来源:origin: apache/activemq-artemis
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(msg.isLargeMessage() ? "LargeMessage(" : "Message(");
buffer.append("messageID=" + msg.getMessageID());
if (msg.getUserID() != null) {
buffer.append(";userMessageID=" + msg.getUserID().toString());
}
buffer.append(";msg=" + msg.toString());
return buffer.toString();
}
代码示例来源:origin: apache/activemq-artemis
/** This will check if a regular message needs to be converted as large message */
public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception {
if (message.isLargeMessage()) {
return message; // nothing to be done on this case
}
if (message.getEncodeSize() > storageManager.getMaxRecordSize()) {
return asLargeMessage(message, storageManager);
} else {
return message;
}
}
代码示例来源:origin: org.apache.activemq/artemis-cli
public void printMessageBody(Message message, boolean encodeTextMessageUTF8) throws Exception {
xmlWriter.writeStartElement(XmlDataConstants.MESSAGE_BODY);
if (message.isLargeMessage()) {
printLargeMessageBody((LargeServerMessage) message);
} else {
if (encodeTextMessageUTF8 && message.toCore().getType() == Message.TEXT_TYPE) {
xmlWriter.writeCData(TextMessageUtil.readBodyText(message.toCore().getReadOnlyBodyBuffer()).toString());
} else {
xmlWriter.writeCData(XmlDataExporterUtil.encodeMessageBodyBase64(message));
}
}
xmlWriter.writeEndElement(); // end MESSAGE_BODY
}
代码示例来源:origin: apache/activemq-artemis
public void printMessageBody(Message message, boolean encodeTextMessageUTF8) throws Exception {
xmlWriter.writeStartElement(XmlDataConstants.MESSAGE_BODY);
if (message.isLargeMessage()) {
printLargeMessageBody((LargeServerMessage) message);
} else {
if (encodeTextMessageUTF8 && message.toCore().getType() == Message.TEXT_TYPE) {
xmlWriter.writeCData(TextMessageUtil.readBodyText(message.toCore().getReadOnlyBodyBuffer()).toString());
} else {
xmlWriter.writeCData(XmlDataExporterUtil.encodeMessageBodyBase64(message));
}
}
xmlWriter.writeEndElement(); // end MESSAGE_BODY
}
代码示例来源:origin: apache/activemq-artemis
@Override
public void addLiveMessage(PagedMessage message) {
if (message.getMessage().isLargeMessage()) {
((LargeServerMessage) message.getMessage()).incrementDelayDeletionCount();
}
messages.add(message);
}
代码示例来源:origin: apache/activemq-artemis
if (message.isLargeMessage()) {
((LargeServerMessage) message).deleteFile();
PagedMessage pagedMessage = new PagedMessageImpl(message, routeQueues(tx, listCtx), transactionID);
if (message.isLargeMessage()) {
((LargeServerMessage) message).setPaged();
代码示例来源:origin: apache/activemq-artemis
public PagedReferenceImpl(final PagePosition position,
final PagedMessage message,
final PageSubscription subscription) {
this.position = position;
this.message = new WeakReference<>(message);
this.subscription = subscription;
if (message != null) {
this.largeMessage = message.getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE;
this.transactionID = message.getTransactionID();
this.messageID = message.getMessage().getMessageID();
this.durable = message.getMessage().isDurable() ? IS_DURABLE : IS_NOT_DURABLE;
this.deliveryTime = message.getMessage().getScheduledDeliveryTime();
//pre-cache the message size so we don't have to reload the message later if it is GC'd
getPersistentSize();
} else {
this.largeMessage = UNDEFINED_IS_LARGE_MESSAGE;
this.transactionID = -2;
this.messageID = -1;
this.messageSize = -1;
this.durable = UNDEFINED_IS_DURABLE;
this.deliveryTime = UNDEFINED_DELIVERY_TIME;
}
}
代码示例来源:origin: apache/activemq-artemis
if (message.isLargeMessage()) {
if (message.isLargeMessage() && this.supportLargeMessage) {
largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, ref);
代码示例来源:origin: apache/activemq-artemis
@Override
public void proceedDeliver(MessageReference reference) throws Exception {
try {
Message message = reference.getMessage();
if (server.hasBrokerMessagePlugins()) {
server.callBrokerMessagePlugins(plugin -> plugin.beforeDeliver(this, reference));
}
if (message.isLargeMessage() && supportLargeMessage) {
if (largeMessageDeliverer == null) {
// This can't really happen as handle had already crated the deliverer
// instead of throwing an exception in weird cases there is no problem on just go ahead and create it
// again here
largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, reference);
}
// The deliverer was prepared during handle, as we can't have more than one pending large message
// as it would return busy if there is anything pending
largeMessageDeliverer.deliver();
} else {
deliverStandardMessage(reference, message);
}
} finally {
lockDelivery.readLock().unlock();
callback.afterDelivery();
if (server.hasBrokerMessagePlugins()) {
server.callBrokerMessagePlugins(plugin -> plugin.afterDeliver(this, reference));
}
}
}
代码示例来源:origin: apache/activemq-artemis
if (msg.getMessage().isLargeMessage()) {
代码示例来源:origin: apache/activemq-artemis
@Override
public void storeMessageTransactional(final long txID, final Message message) throws Exception {
if (message.getMessageID() <= 0) {
throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
}
readLock();
try {
if (message.isLargeMessage()) {
messageJournal.appendAddRecordTransactional(txID, message.getMessageID(), JournalRecordIds.ADD_LARGE_MESSAGE, LargeMessagePersister.getInstance(), message);
} else {
messageJournal.appendAddRecordTransactional(txID, message.getMessageID(), JournalRecordIds.ADD_MESSAGE_PROTOCOL, message.getPersister(), message);
}
} finally {
readUnLock();
}
}
代码示例来源:origin: apache/activemq-artemis
if (message.isLargeMessage()) {
confirmLargeMessageSend(tx, message);
if (message.isLargeMessage()) {
confirmLargeMessageSend(tx, message);
代码示例来源:origin: apache/activemq-artemis
if (!reference.getMessage().isLargeMessage()) {
代码示例来源:origin: apache/activemq-artemis
@Override
public void storeMessage(final Message message) throws Exception {
if (message.getMessageID() <= 0) {
// Sanity check only... this shouldn't happen unless there is a bug
throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
}
readLock();
try {
// Note that we don't sync, the add reference that comes immediately after will sync if
// appropriate
if (message.isLargeMessage()) {
messageJournal.appendAddRecord(message.getMessageID(), JournalRecordIds.ADD_LARGE_MESSAGE, LargeMessagePersister.getInstance(), message, false, getContext(false));
} else {
messageJournal.appendAddRecord(message.getMessageID(), JournalRecordIds.ADD_MESSAGE_PROTOCOL, message.getPersister(), message, false, getContext(false));
}
} finally {
readUnLock();
}
}
代码示例来源:origin: apache/activemq-artemis
if (msg.getMessage() instanceof ICoreMessage && (msg.getMessage()).isLargeMessage()) {
LargeServerMessage lmsg = (LargeServerMessage) msg.getMessage();
代码示例来源:origin: apache/activemq-artemis
if (message.isLargeMessage()) {
deliveringLargeMessage = true;
deliverLargeMessage(dest, ref, (LargeServerMessage) message);
代码示例来源:origin: apache/activemq-artemis
if (message.isLargeMessage()) {
((LargeServerMessage) message).deleteFile();
代码示例来源:origin: apache/activemq-artemis
if (!message.isLargeMessage()) {
long id = storageManager.generateID();
内容来源于网络,如有侵权,请联系作者删除!