使用JMS或ThreadPool发送电子邮件 [英] Using JMS or ThreadPool to send email messages

查看:121
本文介绍了使用JMS或ThreadPool发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道:

我有一个场景。如果用户将产品添加到系统(我正在开发),则会有一个监听器向用户的客户群发送通知,通知用户添加的新产品。

I have a scenario. If a user adds a product to the system (I'm developing), there's a listener that sends a notification to the user's client base notifying of a new product added by the user.

我已经阅读了这个主题并且(看到我从来没有使用 JMS ThreadPool 之前)我想知道是否应该使用JMS或ThreadPooling。

I've read this thread and (seeing I've never used JMS nor ThreadPool before) I was wondering whether I should use JMS or ThreadPooling.

我正在使用Tomcat 5.5及更高版本以及JBoss 5及更高版本(取决于公司的最后手段)来部署我的Web应用程序。

I am using Tomcat 5.5 and higher and JBoss 5 and higher (depending on company last resort) to deploy my web application.

如果我使用JMS,我是否使用 Apache ActiveMQ JBoss Messaging ?它们是否兼容在两个平台上运行(Tomcat和JBoss)?

If I use JMS, do I use Apache ActiveMQ or JBoss Messaging? Are they both compatible to run on both platforms (Tomcat and JBoss)?

提前致谢。

推荐答案

对于应用程序之间的通信,JMS是一个非常好的解决方案,特别是对于事件和通知。 JMS允许使用所谓的异步消息发送和接收这样的通知,由此发送方和接收方彼此不了解并且不需要同时可用。

For communicating between applications, JMS is a very good solution, especially for events and notifications. JMS allows for such notifications to be sent and received using what is known as asynchronous messaging whereby the sender and receiver have no knowledge of one another and no requirement to be available at the same time.

ActiveMQ是一个使用非常广泛的消息代理,它为Java,C / C ++,C#,Perl,PHP,Python,Ruby等提供客户端API。这允许将JMS与使用Java和其他语言编写的应用程序一起使用。

ActiveMQ is a very widely used message broker that provides client APIs for Java, C/C++, C#, Perl, PHP, Python, Ruby and more. This allows the use of JMS with applications written in Java and other languages.

我已经为很多种业务情况多次实现了JMS消息传递来处理事件和通知。绝大多数时候,我已经推荐和/或使用了 Spring JMS ,无论使用什么消息代理。 Spring JMS非常易于使用,非常强大且具有高度可扩展性。 Spring JMS消除了创建自己的消息生成器和消息使用者的复杂性,这可以为您节省大量时间。

I have implemented JMS messaging many, many times for a large variety of business situations to handle events and notifications. The vast majority of these times, I have recommended and/or used Spring JMS no matter what message broker is being used. Spring JMS is incredibly easy to use, extremely robust and highly scalable. Spring JMS removes the complexity of creating your own message producers and message consumers, which can save you a tremendous amount of time.

要了解使用Spring JMS发送消息是多么容易,请查看我最近写的一篇名为使用Spring JmsTemplate发送JMS消息。我还在撰写一篇关于使用Spring JMS接收消息的博客文章。

To see how easy it is to send messages using Spring JMS, check out a blog post I wrote recently titled Using the Spring JmsTemplate to Send JMS Messages. I'm also working on a blog post about receiving messages using Spring JMS.

如果您有任何其他问题,请与我们联系。

If you have any further questions, let me know.

布鲁斯

这篇关于使用JMS或ThreadPool发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆