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

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

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

Message.setConnection介绍

暂无

代码示例

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

  1. @Override
  2. public Response processMessageDispatch(MessageDispatch md) throws Exception {
  3. waitForTransportInterruptionProcessingToComplete();
  4. ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId());
  5. if (dispatcher != null) {
  6. // Copy in case a embedded broker is dispatching via
  7. // vm://
  8. // md.getMessage() == null to signal end of queue
  9. // browse.
  10. Message msg = md.getMessage();
  11. if (msg != null) {
  12. msg = msg.copy();
  13. msg.setReadOnlyBody(true);
  14. msg.setReadOnlyProperties(true);
  15. msg.setRedeliveryCounter(md.getRedeliveryCounter());
  16. msg.setConnection(ActiveMQConnection.this);
  17. msg.setMemoryUsage(null);
  18. md.setMessage(msg);
  19. }
  20. dispatcher.dispatch(md);
  21. } else {
  22. LOG.debug("{} no dispatcher for {} in {}", this, md, dispatchers);
  23. }
  24. return null;
  25. }

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

  1. @Override
  2. public Response processMessageDispatch(MessageDispatch md) throws Exception {
  3. waitForTransportInterruptionProcessingToComplete();
  4. ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId());
  5. if (dispatcher != null) {
  6. // Copy in case a embedded broker is dispatching via
  7. // vm://
  8. // md.getMessage() == null to signal end of queue
  9. // browse.
  10. Message msg = md.getMessage();
  11. if (msg != null) {
  12. msg = msg.copy();
  13. msg.setReadOnlyBody(true);
  14. msg.setReadOnlyProperties(true);
  15. msg.setRedeliveryCounter(md.getRedeliveryCounter());
  16. msg.setConnection(ActiveMQConnection.this);
  17. msg.setMemoryUsage(null);
  18. md.setMessage(msg);
  19. }
  20. dispatcher.dispatch(md);
  21. } else {
  22. LOG.debug("{} no dispatcher for {} in {}", this, md, dispatchers);
  23. }
  24. return null;
  25. }

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

  1. @Override
  2. public Response processMessageDispatch(MessageDispatch md) throws Exception {
  3. waitForTransportInterruptionProcessingToComplete();
  4. ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId());
  5. if (dispatcher != null) {
  6. // Copy in case a embedded broker is dispatching via
  7. // vm://
  8. // md.getMessage() == null to signal end of queue
  9. // browse.
  10. Message msg = md.getMessage();
  11. if (msg != null) {
  12. msg = msg.copy();
  13. msg.setReadOnlyBody(true);
  14. msg.setReadOnlyProperties(true);
  15. msg.setRedeliveryCounter(md.getRedeliveryCounter());
  16. msg.setConnection(ActiveMQConnection.this);
  17. msg.setMemoryUsage(null);
  18. md.setMessage(msg);
  19. }
  20. dispatcher.dispatch(md);
  21. } else {
  22. LOG.debug("{} no dispatcher for {} in {}", this, md, dispatchers);
  23. }
  24. return null;
  25. }

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

  1. @Override
  2. public Response processMessageDispatch(MessageDispatch md) throws Exception {
  3. waitForTransportInterruptionProcessingToComplete();
  4. ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId());
  5. if (dispatcher != null) {
  6. // Copy in case a embedded broker is dispatching via
  7. // vm://
  8. // md.getMessage() == null to signal end of queue
  9. // browse.
  10. Message msg = md.getMessage();
  11. if (msg != null) {
  12. msg = msg.copy();
  13. msg.setReadOnlyBody(true);
  14. msg.setReadOnlyProperties(true);
  15. msg.setRedeliveryCounter(md.getRedeliveryCounter());
  16. msg.setConnection(ActiveMQConnection.this);
  17. msg.setMemoryUsage(null);
  18. md.setMessage(msg);
  19. }
  20. dispatcher.dispatch(md);
  21. } else {
  22. LOG.debug("{} no dispatcher for {} in {}", this, md, dispatchers);
  23. }
  24. return null;
  25. }

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

  1. @Override
  2. public Response processMessageDispatch(MessageDispatch md) throws Exception {
  3. waitForTransportInterruptionProcessingToComplete();
  4. ActiveMQDispatcher dispatcher = dispatchers.get(md.getConsumerId());
  5. if (dispatcher != null) {
  6. // Copy in case a embedded broker is dispatching via
  7. // vm://
  8. // md.getMessage() == null to signal end of queue
  9. // browse.
  10. Message msg = md.getMessage();
  11. if (msg != null) {
  12. msg = msg.copy();
  13. msg.setReadOnlyBody(true);
  14. msg.setReadOnlyProperties(true);
  15. msg.setRedeliveryCounter(md.getRedeliveryCounter());
  16. msg.setConnection(ActiveMQConnection.this);
  17. md.setMessage(msg);
  18. }
  19. dispatcher.dispatch(md);
  20. }
  21. return null;
  22. }

相关文章

Message类方法