简体   繁体   English

在ActiveMQ中使用消息之前,如何检查依赖项服务是否正常工作

[英]How to Check dependency service is working or not, before consume the message in ActiveMQ

  1. In my application i generate the pdf and send email using ActiveMQ.(ie application never wait for pdf generation, it will put the message into queue after that my consumer application get the message from queue and create pdf then send it to customer). 在我的应用程序中,我生成pdf并使用ActiveMQ发送电子邮件。(即,应用程序从不等待pdf生成,在我的消费者应用程序从队列中获取消息并创建pdf之后,它将消息放入队列中,然后将其发送给客户)。
  2. my application built on top of spring-framework 我的应用程序基于spring-framework

  3. i need to stamp the digital signature in my pdf, if the third party digital-signature server is down, i don't want my consumer to take message for queue. 我需要在pdf文件中标记数字签名,如果第三方数字签名服务器关闭,我不希望我的消费者将消息放入队列。

  4. if any possibility to add dependency in consumer before consume message 在消耗消息之前是否有可能在使用者中添加依赖项

This scenario is a textbook use case for using consumer-side transactions with enterprise messaging. 此方案是教科书用例,用于将消费者方事务与企业消息传递一起使用。 Use the SESSION_TRANSACTED or ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE mode in the session. 在会话中使用SESSION_TRANSACTED或ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE模式。 This allows you to roll the message back to the broker in the event the downstream system is down. 这使您可以在下游系统关闭的情况下将消息回滚到代理。 You can add delays or retries within your consumer program, and only acknowledge the message when you know its been sent to the other system. 您可以在使用者程序中添加延迟或重试,并且仅在知道该消息已发送到另一个系统时才对其进行确认。

ref: http://activemq.apache.org/how-do-transactions-work.html 参考: http : //activemq.apache.org/how-do-transactions-work.html

Circuit break won't help you if your reliable() path is down as well. 如果您的authenticate()路径也断开,则断路将不会对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM