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

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

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

Message.getCommandId介绍

暂无

代码示例

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

sb.append(m.getMessageId());
sb.append(',');
sb.append(m.getCommandId());
ProducerId pid = m.getProducerId();
long sid = pid.getSessionId();

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

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit Wait Timeout. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
    }
  }
}

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

@Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

} else {
  Response response = new Response();
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  ExceptionResponse response = new ExceptionResponse(e);
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
} else {

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

sb.append(m.getMessageId());
sb.append(',');
sb.append(m.getCommandId());
ProducerId pid = m.getProducerId();
long sid = pid.getSessionId();

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

sb.append(m.getMessageId());
sb.append(',');
sb.append(m.getCommandId());
ProducerId pid = m.getProducerId();
long sid = pid.getSessionId();

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

sb.append(m.getMessageId());
sb.append(',');
sb.append(m.getCommandId());
ProducerId pid = m.getProducerId();
long sid = pid.getSessionId();

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

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit reached. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
      }
    }
  }
};

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

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit reached. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
    }
  }
}

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

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit reached. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
    }
  }
}

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

@Override
  public void run() {
    TimeoutMessage timeout;
    try {
      while (true) {
        timeout = flowControlTimeoutMessages.take();
        if (timeout != null) {
          synchronized (messagesWaitingForSpace) {
            if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
              ExceptionResponse response = new ExceptionResponse(
                  new ResourceAllocationException(
                      "Usage Manager Memory Limit reached. Stopping producer ("
                          + timeout.message.getProducerId()
                          + ") to prevent flooding "
                          + getActiveMQDestination().getQualifiedName()
                          + "."
                          + " See http://activemq.apache.org/producer-flow-control.html for more info"));
              response.setCorrelationId(timeout.message.getCommandId());
              timeout.context.getConnection().dispatchAsync(response);
            }
          }
        }
      }
    } catch (InterruptedException e) {
      LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
    }
  }
}

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

} else {
  Response response = new Response();
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
if (!sendProducerAck && !context.isInRecoveryMode()) {
  ExceptionResponse response = new ExceptionResponse(e);
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
} else {

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

@Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

@Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

} else {
  Response response = new Response();
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  ExceptionResponse response = new ExceptionResponse(e);
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
} else {

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

@Override
  public void run() {
    try {
      // While waiting for space to free up... the
      // message may have expired.
      if (message.isExpired()) {
        broker.messageExpired(context, message, null);
        getDestinationStatistics().getExpired().increment();
      } else {
        doMessageSend(producerExchange, message);
      }
      if (sendProducerAck) {
        ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
            .getSize());
        context.getConnection().dispatchAsync(ack);
      } else {
        Response response = new Response();
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    } catch (Exception e) {
      if (!sendProducerAck && !context.isInRecoveryMode()) {
        ExceptionResponse response = new ExceptionResponse(e);
        response.setCorrelationId(message.getCommandId());
        context.getConnection().dispatchAsync(response);
      }
    }
  }
});

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

} else {
  Response response = new Response();
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  ExceptionResponse response = new ExceptionResponse(e);
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
} else {

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

} else {
  Response response = new Response();
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  ExceptionResponse response = new ExceptionResponse(e);
  response.setCorrelationId(message.getCommandId());
  context.getConnection().dispatchAsync(response);
} else {

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

coreMessage.putIntProperty(AMQ_MSG_COMMAND_ID, messageSend.getCommandId());
final String corrId = messageSend.getCorrelationId();
if (corrId != null) {

相关文章

微信公众号

最新文章

更多

Message类方法