简体   繁体   English

MDB和JMS之间的区别

[英]Difference between MDB and JMS

Please let me know what is the difference between: 请让我知道有什么区别:

JMS and Message-driven beans are not either/or choice, the two are complimentary. JMS和消息驱动的bean不是/或选择,两者是互补的。

JMS is the API and technology for passing messages around. JMS是用于传递消息的API和技术。 Message-driven beans (MDB) are an API for receiving JMS messages as events in the EJB style. 消息驱动Bean(MDB)是一种API,用于将JMS消息作为EJB样式的事件接收。 There are many ways of handling JMS messages, MDB is just one of them. 处理JMS消息的方法有很多种,MDB只是其中之一。

From the JavaEE tutorial : JavaEE教程

Message-driven beans can implement any messaging type. 消息驱动的bean可以实现任何消息传递类型。 Most commonly, they implement the Java Message Service (JMS) technology. 最常见的是,它们实现了Java消息服务(JMS)技术。

Your subject, by the way, talks abut MBeans - this is entirely different (that refers to the JMX API), and nothing to do with JMS. 顺便说一下,你的主题是MBean - 这完全不同(指的是JMX API),与JMS无关。

JMS is the Java Messaging Service specification; JMS是Java Messaging Service规范; it's the API for queues and topics in Java EE. 它是Java EE中队列和主题的API。

The MDBs that I'm familiar with typically implement the javax.jms.MessageListener interface, encapsulating the topic or queue listener into a component that's managed by the Java EE container. 我熟悉的MDB通常实现javax.jms.MessageListener接口,将主题或队列侦听器封装到由Java EE容器管理的组件中。

But it's been pointed out to me in the comments that this is not a requirement; 但是在评论中我已经指出这不是一个要求; MDBs can be used as part of the Java Connector API. MDB可以用作Java Connector API的一部分。

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

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