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

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

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

  1. sb.append(m.getMessageId());
  2. sb.append(',');
  3. sb.append(m.getCommandId());
  4. ProducerId pid = m.getProducerId();
  5. long sid = pid.getSessionId();

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

  1. @Override
  2. public void run() {
  3. TimeoutMessage timeout;
  4. try {
  5. while (true) {
  6. timeout = flowControlTimeoutMessages.take();
  7. if (timeout != null) {
  8. synchronized (messagesWaitingForSpace) {
  9. if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
  10. ExceptionResponse response = new ExceptionResponse(
  11. new ResourceAllocationException(
  12. "Usage Manager Memory Limit Wait Timeout. Stopping producer ("
  13. + timeout.message.getProducerId()
  14. + ") to prevent flooding "
  15. + getActiveMQDestination().getQualifiedName()
  16. + "."
  17. + " See http://activemq.apache.org/producer-flow-control.html for more info"));
  18. response.setCorrelationId(timeout.message.getCommandId());
  19. timeout.context.getConnection().dispatchAsync(response);
  20. }
  21. }
  22. }
  23. }
  24. } catch (InterruptedException e) {
  25. LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
  26. }
  27. }
  28. }

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

  1. @Override
  2. public void run() {
  3. try {
  4. // While waiting for space to free up... the
  5. // message may have expired.
  6. if (message.isExpired()) {
  7. broker.messageExpired(context, message, null);
  8. getDestinationStatistics().getExpired().increment();
  9. } else {
  10. doMessageSend(producerExchange, message);
  11. }
  12. if (sendProducerAck) {
  13. ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
  14. .getSize());
  15. context.getConnection().dispatchAsync(ack);
  16. } else {
  17. Response response = new Response();
  18. response.setCorrelationId(message.getCommandId());
  19. context.getConnection().dispatchAsync(response);
  20. }
  21. } catch (Exception e) {
  22. if (!sendProducerAck && !context.isInRecoveryMode()) {
  23. ExceptionResponse response = new ExceptionResponse(e);
  24. response.setCorrelationId(message.getCommandId());
  25. context.getConnection().dispatchAsync(response);
  26. }
  27. }
  28. }
  29. });

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

  1. } else {
  2. Response response = new Response();
  3. response.setCorrelationId(message.getCommandId());
  4. context.getConnection().dispatchAsync(response);
  5. if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  6. ExceptionResponse response = new ExceptionResponse(e);
  7. response.setCorrelationId(message.getCommandId());
  8. context.getConnection().dispatchAsync(response);
  9. } else {

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

  1. sb.append(m.getMessageId());
  2. sb.append(',');
  3. sb.append(m.getCommandId());
  4. ProducerId pid = m.getProducerId();
  5. long sid = pid.getSessionId();

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

  1. sb.append(m.getMessageId());
  2. sb.append(',');
  3. sb.append(m.getCommandId());
  4. ProducerId pid = m.getProducerId();
  5. long sid = pid.getSessionId();

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

  1. sb.append(m.getMessageId());
  2. sb.append(',');
  3. sb.append(m.getCommandId());
  4. ProducerId pid = m.getProducerId();
  5. long sid = pid.getSessionId();

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

  1. @Override
  2. public void run() {
  3. TimeoutMessage timeout;
  4. try {
  5. while (true) {
  6. timeout = flowControlTimeoutMessages.take();
  7. if (timeout != null) {
  8. synchronized (messagesWaitingForSpace) {
  9. if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
  10. ExceptionResponse response = new ExceptionResponse(
  11. new ResourceAllocationException(
  12. "Usage Manager Memory Limit reached. Stopping producer ("
  13. + timeout.message.getProducerId()
  14. + ") to prevent flooding "
  15. + getActiveMQDestination().getQualifiedName()
  16. + "."
  17. + " See http://activemq.apache.org/producer-flow-control.html for more info"));
  18. response.setCorrelationId(timeout.message.getCommandId());
  19. timeout.context.getConnection().dispatchAsync(response);
  20. }
  21. }
  22. }
  23. }
  24. } catch (InterruptedException e) {
  25. if (LOG.isDebugEnabled()) {
  26. LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
  27. }
  28. }
  29. }
  30. };

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

  1. @Override
  2. public void run() {
  3. TimeoutMessage timeout;
  4. try {
  5. while (true) {
  6. timeout = flowControlTimeoutMessages.take();
  7. if (timeout != null) {
  8. synchronized (messagesWaitingForSpace) {
  9. if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
  10. ExceptionResponse response = new ExceptionResponse(
  11. new ResourceAllocationException(
  12. "Usage Manager Memory Limit reached. Stopping producer ("
  13. + timeout.message.getProducerId()
  14. + ") to prevent flooding "
  15. + getActiveMQDestination().getQualifiedName()
  16. + "."
  17. + " See http://activemq.apache.org/producer-flow-control.html for more info"));
  18. response.setCorrelationId(timeout.message.getCommandId());
  19. timeout.context.getConnection().dispatchAsync(response);
  20. }
  21. }
  22. }
  23. }
  24. } catch (InterruptedException e) {
  25. LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
  26. }
  27. }
  28. }

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

  1. @Override
  2. public void run() {
  3. TimeoutMessage timeout;
  4. try {
  5. while (true) {
  6. timeout = flowControlTimeoutMessages.take();
  7. if (timeout != null) {
  8. synchronized (messagesWaitingForSpace) {
  9. if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
  10. ExceptionResponse response = new ExceptionResponse(
  11. new ResourceAllocationException(
  12. "Usage Manager Memory Limit reached. Stopping producer ("
  13. + timeout.message.getProducerId()
  14. + ") to prevent flooding "
  15. + getActiveMQDestination().getQualifiedName()
  16. + "."
  17. + " See http://activemq.apache.org/producer-flow-control.html for more info"));
  18. response.setCorrelationId(timeout.message.getCommandId());
  19. timeout.context.getConnection().dispatchAsync(response);
  20. }
  21. }
  22. }
  23. }
  24. } catch (InterruptedException e) {
  25. LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
  26. }
  27. }
  28. }

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

  1. @Override
  2. public void run() {
  3. TimeoutMessage timeout;
  4. try {
  5. while (true) {
  6. timeout = flowControlTimeoutMessages.take();
  7. if (timeout != null) {
  8. synchronized (messagesWaitingForSpace) {
  9. if (messagesWaitingForSpace.remove(timeout.message.getMessageId()) != null) {
  10. ExceptionResponse response = new ExceptionResponse(
  11. new ResourceAllocationException(
  12. "Usage Manager Memory Limit reached. Stopping producer ("
  13. + timeout.message.getProducerId()
  14. + ") to prevent flooding "
  15. + getActiveMQDestination().getQualifiedName()
  16. + "."
  17. + " See http://activemq.apache.org/producer-flow-control.html for more info"));
  18. response.setCorrelationId(timeout.message.getCommandId());
  19. timeout.context.getConnection().dispatchAsync(response);
  20. }
  21. }
  22. }
  23. }
  24. } catch (InterruptedException e) {
  25. LOG.debug(getName() + "Producer Flow Control Timeout Task is stopping");
  26. }
  27. }
  28. }

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

  1. } else {
  2. Response response = new Response();
  3. response.setCorrelationId(message.getCommandId());
  4. context.getConnection().dispatchAsync(response);
  5. if (!sendProducerAck && !context.isInRecoveryMode()) {
  6. ExceptionResponse response = new ExceptionResponse(e);
  7. response.setCorrelationId(message.getCommandId());
  8. context.getConnection().dispatchAsync(response);
  9. } else {

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

  1. @Override
  2. public void run() {
  3. try {
  4. // While waiting for space to free up... the
  5. // message may have expired.
  6. if (message.isExpired()) {
  7. broker.messageExpired(context, message, null);
  8. getDestinationStatistics().getExpired().increment();
  9. } else {
  10. doMessageSend(producerExchange, message);
  11. }
  12. if (sendProducerAck) {
  13. ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
  14. .getSize());
  15. context.getConnection().dispatchAsync(ack);
  16. } else {
  17. Response response = new Response();
  18. response.setCorrelationId(message.getCommandId());
  19. context.getConnection().dispatchAsync(response);
  20. }
  21. } catch (Exception e) {
  22. if (!sendProducerAck && !context.isInRecoveryMode()) {
  23. ExceptionResponse response = new ExceptionResponse(e);
  24. response.setCorrelationId(message.getCommandId());
  25. context.getConnection().dispatchAsync(response);
  26. }
  27. }
  28. }
  29. });

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

  1. @Override
  2. public void run() {
  3. try {
  4. // While waiting for space to free up... the
  5. // message may have expired.
  6. if (message.isExpired()) {
  7. broker.messageExpired(context, message, null);
  8. getDestinationStatistics().getExpired().increment();
  9. } else {
  10. doMessageSend(producerExchange, message);
  11. }
  12. if (sendProducerAck) {
  13. ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
  14. .getSize());
  15. context.getConnection().dispatchAsync(ack);
  16. } else {
  17. Response response = new Response();
  18. response.setCorrelationId(message.getCommandId());
  19. context.getConnection().dispatchAsync(response);
  20. }
  21. } catch (Exception e) {
  22. if (!sendProducerAck && !context.isInRecoveryMode()) {
  23. ExceptionResponse response = new ExceptionResponse(e);
  24. response.setCorrelationId(message.getCommandId());
  25. context.getConnection().dispatchAsync(response);
  26. }
  27. }
  28. }
  29. });

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

  1. public void run() {
  2. try {
  3. // While waiting for space to free up... the
  4. // message may have expired.
  5. if (message.isExpired()) {
  6. broker.messageExpired(context, message, null);
  7. getDestinationStatistics().getExpired().increment();
  8. } else {
  9. doMessageSend(producerExchange, message);
  10. }
  11. if (sendProducerAck) {
  12. ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
  13. .getSize());
  14. context.getConnection().dispatchAsync(ack);
  15. } else {
  16. Response response = new Response();
  17. response.setCorrelationId(message.getCommandId());
  18. context.getConnection().dispatchAsync(response);
  19. }
  20. } catch (Exception e) {
  21. if (!sendProducerAck && !context.isInRecoveryMode()) {
  22. ExceptionResponse response = new ExceptionResponse(e);
  23. response.setCorrelationId(message.getCommandId());
  24. context.getConnection().dispatchAsync(response);
  25. }
  26. }
  27. }
  28. });

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

  1. } else {
  2. Response response = new Response();
  3. response.setCorrelationId(message.getCommandId());
  4. context.getConnection().dispatchAsync(response);
  5. if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  6. ExceptionResponse response = new ExceptionResponse(e);
  7. response.setCorrelationId(message.getCommandId());
  8. context.getConnection().dispatchAsync(response);
  9. } else {

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

  1. @Override
  2. public void run() {
  3. try {
  4. // While waiting for space to free up... the
  5. // message may have expired.
  6. if (message.isExpired()) {
  7. broker.messageExpired(context, message, null);
  8. getDestinationStatistics().getExpired().increment();
  9. } else {
  10. doMessageSend(producerExchange, message);
  11. }
  12. if (sendProducerAck) {
  13. ProducerAck ack = new ProducerAck(producerInfo.getProducerId(), message
  14. .getSize());
  15. context.getConnection().dispatchAsync(ack);
  16. } else {
  17. Response response = new Response();
  18. response.setCorrelationId(message.getCommandId());
  19. context.getConnection().dispatchAsync(response);
  20. }
  21. } catch (Exception e) {
  22. if (!sendProducerAck && !context.isInRecoveryMode()) {
  23. ExceptionResponse response = new ExceptionResponse(e);
  24. response.setCorrelationId(message.getCommandId());
  25. context.getConnection().dispatchAsync(response);
  26. }
  27. }
  28. }
  29. });

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

  1. } else {
  2. Response response = new Response();
  3. response.setCorrelationId(message.getCommandId());
  4. context.getConnection().dispatchAsync(response);
  5. if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  6. ExceptionResponse response = new ExceptionResponse(e);
  7. response.setCorrelationId(message.getCommandId());
  8. context.getConnection().dispatchAsync(response);
  9. } else {

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

  1. } else {
  2. Response response = new Response();
  3. response.setCorrelationId(message.getCommandId());
  4. context.getConnection().dispatchAsync(response);
  5. if (!sendProducerAck && !context.isInRecoveryMode() && !brokerService.isStopping()) {
  6. ExceptionResponse response = new ExceptionResponse(e);
  7. response.setCorrelationId(message.getCommandId());
  8. context.getConnection().dispatchAsync(response);
  9. } else {

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

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

相关文章

Message类方法