org.apache.activemq.artemis.api.core.Message.isLargeMessage()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(573)

本文整理了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

Message.isLargeMessage介绍

暂无

代码示例

代码示例来源:origin: apache/activemq-artemis

  1. private void initializeIsLargeMessage() {
  2. assert largeMessage == UNDEFINED_IS_LARGE_MESSAGE && message != null;
  3. largeMessage = getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE;
  4. }

代码示例来源:origin: apache/activemq-artemis

  1. @Override
  2. public String toString() {
  3. StringBuffer buffer = new StringBuffer();
  4. buffer.append(msg.isLargeMessage() ? "LargeMessage(" : "Message(");
  5. buffer.append("messageID=" + msg.getMessageID());
  6. if (msg.getUserID() != null) {
  7. buffer.append(";userMessageID=" + msg.getUserID().toString());
  8. }
  9. buffer.append(";msg=" + msg.toString());
  10. return buffer.toString();
  11. }

代码示例来源:origin: apache/activemq-artemis

  1. /** This will check if a regular message needs to be converted as large message */
  2. public static Message checkLargeMessage(Message message, StorageManager storageManager) throws Exception {
  3. if (message.isLargeMessage()) {
  4. return message; // nothing to be done on this case
  5. }
  6. if (message.getEncodeSize() > storageManager.getMaxRecordSize()) {
  7. return asLargeMessage(message, storageManager);
  8. } else {
  9. return message;
  10. }
  11. }

代码示例来源:origin: org.apache.activemq/artemis-cli

  1. public void printMessageBody(Message message, boolean encodeTextMessageUTF8) throws Exception {
  2. xmlWriter.writeStartElement(XmlDataConstants.MESSAGE_BODY);
  3. if (message.isLargeMessage()) {
  4. printLargeMessageBody((LargeServerMessage) message);
  5. } else {
  6. if (encodeTextMessageUTF8 && message.toCore().getType() == Message.TEXT_TYPE) {
  7. xmlWriter.writeCData(TextMessageUtil.readBodyText(message.toCore().getReadOnlyBodyBuffer()).toString());
  8. } else {
  9. xmlWriter.writeCData(XmlDataExporterUtil.encodeMessageBodyBase64(message));
  10. }
  11. }
  12. xmlWriter.writeEndElement(); // end MESSAGE_BODY
  13. }

代码示例来源:origin: apache/activemq-artemis

  1. public void printMessageBody(Message message, boolean encodeTextMessageUTF8) throws Exception {
  2. xmlWriter.writeStartElement(XmlDataConstants.MESSAGE_BODY);
  3. if (message.isLargeMessage()) {
  4. printLargeMessageBody((LargeServerMessage) message);
  5. } else {
  6. if (encodeTextMessageUTF8 && message.toCore().getType() == Message.TEXT_TYPE) {
  7. xmlWriter.writeCData(TextMessageUtil.readBodyText(message.toCore().getReadOnlyBodyBuffer()).toString());
  8. } else {
  9. xmlWriter.writeCData(XmlDataExporterUtil.encodeMessageBodyBase64(message));
  10. }
  11. }
  12. xmlWriter.writeEndElement(); // end MESSAGE_BODY
  13. }

代码示例来源:origin: apache/activemq-artemis

  1. @Override
  2. public void addLiveMessage(PagedMessage message) {
  3. if (message.getMessage().isLargeMessage()) {
  4. ((LargeServerMessage) message.getMessage()).incrementDelayDeletionCount();
  5. }
  6. messages.add(message);
  7. }

代码示例来源:origin: apache/activemq-artemis

  1. if (message.isLargeMessage()) {
  2. ((LargeServerMessage) message).deleteFile();
  3. PagedMessage pagedMessage = new PagedMessageImpl(message, routeQueues(tx, listCtx), transactionID);
  4. if (message.isLargeMessage()) {
  5. ((LargeServerMessage) message).setPaged();

代码示例来源:origin: apache/activemq-artemis

  1. public PagedReferenceImpl(final PagePosition position,
  2. final PagedMessage message,
  3. final PageSubscription subscription) {
  4. this.position = position;
  5. this.message = new WeakReference<>(message);
  6. this.subscription = subscription;
  7. if (message != null) {
  8. this.largeMessage = message.getMessage().isLargeMessage() ? IS_LARGE_MESSAGE : IS_NOT_LARGE_MESSAGE;
  9. this.transactionID = message.getTransactionID();
  10. this.messageID = message.getMessage().getMessageID();
  11. this.durable = message.getMessage().isDurable() ? IS_DURABLE : IS_NOT_DURABLE;
  12. this.deliveryTime = message.getMessage().getScheduledDeliveryTime();
  13. //pre-cache the message size so we don't have to reload the message later if it is GC'd
  14. getPersistentSize();
  15. } else {
  16. this.largeMessage = UNDEFINED_IS_LARGE_MESSAGE;
  17. this.transactionID = -2;
  18. this.messageID = -1;
  19. this.messageSize = -1;
  20. this.durable = UNDEFINED_IS_DURABLE;
  21. this.deliveryTime = UNDEFINED_DELIVERY_TIME;
  22. }
  23. }

代码示例来源:origin: apache/activemq-artemis

  1. if (message.isLargeMessage()) {
  2. if (message.isLargeMessage() && this.supportLargeMessage) {
  3. largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, ref);

代码示例来源:origin: apache/activemq-artemis

  1. @Override
  2. public void proceedDeliver(MessageReference reference) throws Exception {
  3. try {
  4. Message message = reference.getMessage();
  5. if (server.hasBrokerMessagePlugins()) {
  6. server.callBrokerMessagePlugins(plugin -> plugin.beforeDeliver(this, reference));
  7. }
  8. if (message.isLargeMessage() && supportLargeMessage) {
  9. if (largeMessageDeliverer == null) {
  10. // This can't really happen as handle had already crated the deliverer
  11. // instead of throwing an exception in weird cases there is no problem on just go ahead and create it
  12. // again here
  13. largeMessageDeliverer = new LargeMessageDeliverer((LargeServerMessage) message, reference);
  14. }
  15. // The deliverer was prepared during handle, as we can't have more than one pending large message
  16. // as it would return busy if there is anything pending
  17. largeMessageDeliverer.deliver();
  18. } else {
  19. deliverStandardMessage(reference, message);
  20. }
  21. } finally {
  22. lockDelivery.readLock().unlock();
  23. callback.afterDelivery();
  24. if (server.hasBrokerMessagePlugins()) {
  25. server.callBrokerMessagePlugins(plugin -> plugin.afterDeliver(this, reference));
  26. }
  27. }
  28. }

代码示例来源:origin: apache/activemq-artemis

  1. if (msg.getMessage().isLargeMessage()) {

代码示例来源:origin: apache/activemq-artemis

  1. @Override
  2. public void storeMessageTransactional(final long txID, final Message message) throws Exception {
  3. if (message.getMessageID() <= 0) {
  4. throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
  5. }
  6. readLock();
  7. try {
  8. if (message.isLargeMessage()) {
  9. messageJournal.appendAddRecordTransactional(txID, message.getMessageID(), JournalRecordIds.ADD_LARGE_MESSAGE, LargeMessagePersister.getInstance(), message);
  10. } else {
  11. messageJournal.appendAddRecordTransactional(txID, message.getMessageID(), JournalRecordIds.ADD_MESSAGE_PROTOCOL, message.getPersister(), message);
  12. }
  13. } finally {
  14. readUnLock();
  15. }
  16. }

代码示例来源:origin: apache/activemq-artemis

  1. if (message.isLargeMessage()) {
  2. confirmLargeMessageSend(tx, message);
  3. if (message.isLargeMessage()) {
  4. confirmLargeMessageSend(tx, message);

代码示例来源:origin: apache/activemq-artemis

  1. if (!reference.getMessage().isLargeMessage()) {

代码示例来源:origin: apache/activemq-artemis

  1. @Override
  2. public void storeMessage(final Message message) throws Exception {
  3. if (message.getMessageID() <= 0) {
  4. // Sanity check only... this shouldn't happen unless there is a bug
  5. throw ActiveMQMessageBundle.BUNDLE.messageIdNotAssigned();
  6. }
  7. readLock();
  8. try {
  9. // Note that we don't sync, the add reference that comes immediately after will sync if
  10. // appropriate
  11. if (message.isLargeMessage()) {
  12. messageJournal.appendAddRecord(message.getMessageID(), JournalRecordIds.ADD_LARGE_MESSAGE, LargeMessagePersister.getInstance(), message, false, getContext(false));
  13. } else {
  14. messageJournal.appendAddRecord(message.getMessageID(), JournalRecordIds.ADD_MESSAGE_PROTOCOL, message.getPersister(), message, false, getContext(false));
  15. }
  16. } finally {
  17. readUnLock();
  18. }
  19. }

代码示例来源:origin: apache/activemq-artemis

  1. if (msg.getMessage() instanceof ICoreMessage && (msg.getMessage()).isLargeMessage()) {
  2. LargeServerMessage lmsg = (LargeServerMessage) msg.getMessage();

代码示例来源:origin: apache/activemq-artemis

  1. if (message.isLargeMessage()) {
  2. deliveringLargeMessage = true;
  3. deliverLargeMessage(dest, ref, (LargeServerMessage) message);

代码示例来源:origin: apache/activemq-artemis

  1. if (message.isLargeMessage()) {
  2. ((LargeServerMessage) message).deleteFile();

代码示例来源:origin: apache/activemq-artemis

  1. if (!message.isLargeMessage()) {
  2. long id = storageManager.generateID();

相关文章