org.apache.activemq.command.Message.getPriority()方法的使用及代码示例

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

本文整理了Java中org.apache.activemq.command.Message.getPriority()方法的一些代码示例,展示了Message.getPriority()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getPriority()方法的具体详情如下:
包路径:org.apache.activemq.command.Message
类名称:Message
方法名:getPriority

Message.getPriority介绍

暂无

代码示例

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

looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());

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

@Override
public void updateMessage(Message message) throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter());
  }
  KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand();
  KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setPriority(message.getPriority());
  command.setPrioritySupported(prioritizedMessages);
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  updateMessageCommand.setMessage(command);
  store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null);
}

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  MessageId messageId = message.getMessageId();
  if (audit != null && audit.isDuplicate(message)) {
    if (LOG.isDebugEnabled()) {
    sequenceId = persistenceAdapter.getNextSequenceId();
    final long sequence = sequenceId;
    message.getMessageId().setEntryLocator(sequence);
    adapter.doAddMessage(c, sequenceId, messageId, destination, data, message.getExpiration(),
        this.isPrioritizedMessages() ? message.getPriority() : 0, xaXid);
  } catch (SQLException e) {
    JDBCPersistenceAdapter.log("JDBC Failure: ", e);
    onAdd(message, sequenceId, message.getPriority());

代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq

protected void populateInitialHeaders(Map<String, Object> map) {
    Message message = null;
    if (command.isMessage()) {
      message = (Message) this.command;
    }
    if (command.isMessageDispatch()) {
      message = ((MessageDispatch) command).getMessage();
    }

    if (message != null) {
      map.put("JMSCorrelationID", message.getCorrelationId());
      map.put("JMSDestination", message.getDestination());
      map.put("JMSExpiration", message.getExpiration());
      map.put("JMSMessageID", message.getMessageId().toString());
      map.put("JMSPriority", message.getPriority());
      map.put("JMSRedelivered", message.isRedelivered());
      map.put("JMSTimestamp", message.getTimestamp());
      map.put("JMSReplyTo", message.getReplyTo());
      map.put("JMSType", message.getType());
      map.put("JMSXGroupID", message.getGroupID());
      map.put("JMSXGroupSeq", message.getGroupSequence());
      map.put("JMSXUserID", message.getUserID());
    }
  }
}

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  final KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setTransactionInfo(TransactionIdConversion.convert(transactionIdTransformer.transform(message.getTransactionId())));
  command.setPriority(message.getPriority());
  command.setPrioritySupported(isPrioritizedMessages());
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  store(command, isEnableJournalDiskSyncs() && message.isResponseRequired(), new IndexAware() {
    // sync add? (for async, future present from getFutureOrSequenceLong)
    Object possibleFuture = message.getMessageId().getFutureOrSequenceLong();
    @Override
    public void sequenceAssignedWithIndexLocked(final long sequence) {
      message.getMessageId().setFutureOrSequenceLong(sequence);
      if (indexListener != null) {
        if (possibleFuture == null) {
          trackPendingAdd(dest, sequence);
          indexListener.onAdd(new IndexListener.MessageContext(context, message, new Runnable() {
            @Override
            public void run() {
              trackPendingAddComplete(dest, sequence);
            }
          }));
        }
      }
    }
  }, null);
}

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

looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());

代码示例来源:origin: pierre/meteo

public void addMessage(ConnectionContext context, Message message) throws IOException {
  MessageId messageId = message.getMessageId();
  if (audit != null && audit.isDuplicate(message)) {
    if (LOG.isDebugEnabled()) {
    adapter.doAddMessage(c,sequenceId, messageId, destination, data, message.getExpiration(), message.getPriority());
  } catch (SQLException e) {
    JDBCPersistenceAdapter.log("JDBC Failure: ", e);
    c.close();
  onAdd(sequenceId, message.getPriority());

代码示例来源:origin: pierre/meteo

public void addMessage(ConnectionContext context, Message message) throws IOException {
  KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toString());
  command.setTransactionInfo(createTransactionInfo(message.getTransactionId()));
  command.setPriority(message.getPriority());
  command.setPrioritySupported(isPrioritizedMessages());
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  store(command, isEnableJournalDiskSyncs() && message.isResponseRequired(), null, null);
  
}

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

@Override
public void updateMessage(Message message) throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter());
  }
  KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand();
  KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setPriority(message.getPriority());
  command.setPrioritySupported(prioritizedMessages);
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  updateMessageCommand.setMessage(command);
  store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null);
}

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

looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  MessageId messageId = message.getMessageId();
  if (audit != null && audit.isDuplicate(message)) {
    if (LOG.isDebugEnabled()) {
    sequenceId = persistenceAdapter.getNextSequenceId();
    final long sequence = sequenceId;
    message.getMessageId().setEntryLocator(sequence);
    adapter.doAddMessage(c, sequenceId, messageId, destination, data, message.getExpiration(),
        this.isPrioritizedMessages() ? message.getPriority() : 0, xaXid);
  } catch (SQLException e) {
    JDBCPersistenceAdapter.log("JDBC Failure: ", e);
    onAdd(message, sequenceId, message.getPriority());

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  final KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setTransactionInfo(TransactionIdConversion.convert(transactionIdTransformer.transform(message.getTransactionId())));
  command.setPriority(message.getPriority());
  command.setPrioritySupported(isPrioritizedMessages());
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  store(command, isEnableJournalDiskSyncs() && message.isResponseRequired(), new IndexAware() {
    // sync add? (for async, future present from getFutureOrSequenceLong)
    Object possibleFuture = message.getMessageId().getFutureOrSequenceLong();
    @Override
    public void sequenceAssignedWithIndexLocked(final long sequence) {
      message.getMessageId().setFutureOrSequenceLong(sequence);
      if (indexListener != null) {
        if (possibleFuture == null) {
          trackPendingAdd(dest, sequence);
          indexListener.onAdd(new IndexListener.MessageContext(context, message, new Runnable() {
            @Override
            public void run() {
              trackPendingAddComplete(dest, sequence);
            }
          }));
        }
      }
    }
  }, null);
}

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

@Override
public void updateMessage(Message message) throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter());
  }
  KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand();
  KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setPriority(message.getPriority());
  command.setPrioritySupported(prioritizedMessages);
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  updateMessageCommand.setMessage(command);
  store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null);
}

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

looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());

代码示例来源:origin: org.apache.activemq/activemq-jdbc-store

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  MessageId messageId = message.getMessageId();
  if (audit != null && audit.isDuplicate(message)) {
    if (LOG.isDebugEnabled()) {
    sequenceId = persistenceAdapter.getNextSequenceId();
    final long sequence = sequenceId;
    message.getMessageId().setEntryLocator(sequence);
    adapter.doAddMessage(c, sequenceId, messageId, destination, data, message.getExpiration(),
        this.isPrioritizedMessages() ? message.getPriority() : 0, xaXid);
  } catch (SQLException e) {
    JDBCPersistenceAdapter.log("JDBC Failure: ", e);
    onAdd(message, sequenceId, message.getPriority());

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  final KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setTransactionInfo(TransactionIdConversion.convert(transactionIdTransformer.transform(message.getTransactionId())));
  command.setPriority(message.getPriority());
  command.setPrioritySupported(isPrioritizedMessages());
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  store(command, isEnableJournalDiskSyncs() && message.isResponseRequired(), new IndexAware() {
    // sync add? (for async, future present from getFutureOrSequenceLong)
    Object possibleFuture = message.getMessageId().getFutureOrSequenceLong();
    @Override
    public void sequenceAssignedWithIndexLocked(final long sequence) {
      message.getMessageId().setFutureOrSequenceLong(sequence);
      if (indexListener != null) {
        if (possibleFuture == null) {
          trackPendingAdd(dest, sequence);
          indexListener.onAdd(new IndexListener.MessageContext(context, message, new Runnable() {
            @Override
            public void run() {
              trackPendingAddComplete(dest, sequence);
            }
          }));
        }
      }
    }
  }, null);
}

代码示例来源:origin: org.apache.activemq/activemq-kahadb-store

@Override
public void updateMessage(Message message) throws IOException {
  if (LOG.isTraceEnabled()) {
    LOG.trace("updating: " + message.getMessageId() + " with deliveryCount: " + message.getRedeliveryCounter());
  }
  KahaUpdateMessageCommand updateMessageCommand = new KahaUpdateMessageCommand();
  KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setPriority(message.getPriority());
  command.setPrioritySupported(prioritizedMessages);
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  updateMessageCommand.setMessage(command);
  store(updateMessageCommand, isEnableJournalDiskSyncs(), null, null);
}

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

looseMarshalCachedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalDestination(), dataOut);
looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getOriginalTransactionId(), dataOut);
looseMarshalString(info.getGroupID(), dataOut);
dataOut.writeInt(info.getGroupSequence());
looseMarshalString(info.getCorrelationId(), dataOut);
dataOut.writeBoolean(info.isPersistent());
looseMarshalLong(wireFormat, info.getExpiration(), dataOut);
dataOut.writeByte(info.getPriority());
looseMarshalNestedObject(wireFormat, (DataStructure)info.getReplyTo(), dataOut);
looseMarshalLong(wireFormat, info.getTimestamp(), dataOut);
looseMarshalString(info.getType(), dataOut);
looseMarshalCachedObject(wireFormat, (DataStructure)info.getTargetConsumerId(), dataOut);
dataOut.writeBoolean(info.isCompressed());
dataOut.writeInt(info.getRedeliveryCounter());
looseMarshalObjectArray(wireFormat, info.getBrokerPath(), dataOut);
looseMarshalLong(wireFormat, info.getArrival(), dataOut);
looseMarshalString(info.getUserID(), dataOut);
dataOut.writeBoolean(info.isRecievedByDFBridge());

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

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  MessageId messageId = message.getMessageId();
  if (audit != null && audit.isDuplicate(message)) {
    if (LOG.isDebugEnabled()) {
    sequenceId = persistenceAdapter.getNextSequenceId();
    final long sequence = sequenceId;
    message.getMessageId().setEntryLocator(sequence);
    adapter.doAddMessage(c, sequenceId, messageId, destination, data, message.getExpiration(),
        this.isPrioritizedMessages() ? message.getPriority() : 0, xaXid);
  } catch (SQLException e) {
    JDBCPersistenceAdapter.log("JDBC Failure: ", e);
    onAdd(message, sequenceId, message.getPriority());

代码示例来源:origin: org.apache.activemq/activemq-kahadb-store

@Override
public void addMessage(final ConnectionContext context, final Message message) throws IOException {
  final KahaAddMessageCommand command = new KahaAddMessageCommand();
  command.setDestination(dest);
  command.setMessageId(message.getMessageId().toProducerKey());
  command.setTransactionInfo(TransactionIdConversion.convert(transactionIdTransformer.transform(message.getTransactionId())));
  command.setPriority(message.getPriority());
  command.setPrioritySupported(isPrioritizedMessages());
  org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(message);
  command.setMessage(new Buffer(packet.getData(), packet.getOffset(), packet.getLength()));
  store(command, isEnableJournalDiskSyncs() && message.isResponseRequired(), new IndexAware() {
    // sync add? (for async, future present from getFutureOrSequenceLong)
    Object possibleFuture = message.getMessageId().getFutureOrSequenceLong();
    @Override
    public void sequenceAssignedWithIndexLocked(final long sequence) {
      message.getMessageId().setFutureOrSequenceLong(sequence);
      if (indexListener != null) {
        if (possibleFuture == null) {
          trackPendingAdd(dest, sequence);
          indexListener.onAdd(new IndexListener.MessageContext(context, message, new Runnable() {
            @Override
            public void run() {
              trackPendingAddComplete(dest, sequence);
            }
          }));
        }
      }
    }
  }, null);
}

相关文章

Message类方法