消息驱动bean(MDB)可以在“外部"侦听消息吗? MQ? [英] Can Message driven beans (MDB) listen on "external" MQ?

查看:115
本文介绍了消息驱动bean(MDB)可以在“外部"侦听消息吗? MQ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图理解与MDB,MQ,JMS相关的概念.在问这个问题之前,我曾对SO进行过研究.

I am trying to understand concepts related to MDB, MQ, JMS. I did research on SO before asking this question.

这是可能的情况吗?

部署在Application Server上的MDB,例如JBOSS(在物理服务器A上).

MDB deployed on Application Server, say on JBOSS (on physical Server-A).

另一台物理服务器B上的MQ(例如ApacheMQ).

MQ (say ApacheMQ) on a difference physical server-B.

那么部署在物理服务器A中的MDB是否可以从物理服务器B获取消息?

So can the MDB deployed in physical server-A get messages from physical server-B?

如果可能的话,那么MDB是否使用JMS API?

If this is possible, then does MDB use JMS API's?

我听说Jboss拥有MQ,我认为它与Jboss应用服务器一起使用MQ.但是我希望MDB位于不同的服务器中,而MQ服务器位于不同的物理服务器中.

I have heard Jboss has MQ, which i presume MQ withing Jboss application server; however i want MDB in a different server and MQ server on a different physical server.

感谢您的理解.

推荐答案

这有4个真实部分.

1)您的应用程序. MDB是实现J2EE消息驱动Bean API的应用程序,以最简单的形式表示它具有onMessage()函数,当消息到达时,它将由应用程序服务器调用.

1) Your application. An MDB is an application which implements the J2EE Message Driven Bean API, which in its simplest form means it has an onMessage() function which will be invoked by the application server when messages arrive.

2)J2EE应用服务器JBOSS是一个示例.这将从MQ客户端接收消息,并将其转发到MDB.

2) The J2EE application server, JBOSS is an example. This receives messages from the MQ client, and forwards them to the MDB.

3)MQ客户端.这是由MQ提供程序(IBM/Apache/etc)编写的代码,该代码实现J2EE的JCA RA和JMS部分.应用程序可以通过JMS与该客户端进行交互以放置和获取消息,但是当您作为MDB进行交互时,将通过onMessage()方法来驱动该应用程序.该客户端将消息传递给应用服务器,该服务器驱动应用.

3) The MQ client. This is the code written by the MQ provider (IBM/Apache/etc) which implements the JCA RA and JMS parts of J2EE. Applications can interact with this client via JMS to put and get messages, though when you're interacting as an MDB you'll be driven via your onMessage() method. This client hands messages to the application server, which drives the applications.

4)MQ服务器. IBM MQ将此称为队列管理器",并且它可以存在于任何地方. #3的客户端将通过网络连接到队列管理器.

4) The MQ server. IBM MQ calls this a 'queue manager', and this can exist anywhere. The client from #3 will connect to the queue manager over the network.

#1,#2和#3必须位于同一台物理计算机上(并在同一JVM中运行). #4可以通过网络访问任何地方.

#1, #2, and #3 need to be on the same physical machine (and run in the same JVM). #4 can be anywhere as its accessed over the network.

要解决您的问题,

那么部署在物理服务器A中的MDB是否可以从物理服务器B获取消息?

So can the MDB deployed in physical server-A get messages from physical server-B?

如果可能的话,那么MDB是否使用JMS API?

If this is possible, then does MDB use JMS API's?

MDB由应用服务器使用J2EE API驱动,JMS只是其中的一部分.

The MDB is driven by the application server using the J2EE API, JMS is just a part of this.

顺便说一句,"MQ"是产品的名称,而不是概念.通用名称是消息传递提供者". IBM MQ和ApacheMQ都是消息传递提供程序.

By the way, 'MQ' is the name of product rather than a concept. The generic name is 'Messaging Provider'. IBM MQ and ApacheMQ are both messaging providers.

这篇关于消息驱动bean(MDB)可以在“外部"侦听消息吗? MQ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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