问题描述
我有一个要安装到Websphere Liberty服务器中的非JMS MDB.
I have a non-JMS MDB that I'm installing into a Websphere Liberty server.
package mdb.test;
import javax.ejb.MessageDriven;
@MessageDriven()
public class TheMDB implements MyOwnListener {
public TheMDB() {}
@Override
public void onMyOwnMessage(MyOwnMessage message) {}
}
在没有进一步配置的情况下,服务器将显示以下消息:
Without further configuration, the server gives the following message:
MDB是否必须具有激活规范?我希望它可以被激活,而不必向服务器添加更多配置.
Do MDBs have to have an activation specification? I'd like it to just be activated, without having to add further configuration to the server.
推荐答案
服务器实质上是在告诉您它已找到消息终结点,但没有任何消息可传递给它.您需要添加一个激活规范(JMS或JCA)以允许Bean接收消息.有关定义JCA激活规范的一些信息:
Essentially the server is telling you that it founds a message endpoint but there is nothing delivering messages to it. You need to add an activation specification (either JMS or JCA) to allow the bean to receive messages. Some information on defining JCA activation specs:
我不知道一种将bean绑定到激活规范的方法.由于其功能是处理消息,因此如果没有激活规范,它几乎没有用处.您可能需要伪装您的RA,以编写激活规范以取得进展,即使它尚未产生消息也是如此.
I'm not aware of a way to activate the bean without it being tied to an activation spec. Since its function is to process messages, it is of little use without an activation spec. You might need to dummy up enough of your RA to code the activation spec to make progress, even if it is not producing messages yet.
这篇关于消息驱动bean是否需要激活规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!