消息驱动bean是否需要激活规范? [英] Are activation specs required for message-driven beans?

查看:74
本文介绍了消息驱动bean是否需要激活规范?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要安装到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:

[警告] CNTR4015W:TheMDB消息驱动的bean的消息端点不能被激活,因为mdb.test/TheMDB激活规范不可用.在激活规范可用之前,消息端点将不会接收消息.

[WARNING ] CNTR4015W: The message endpoint for the TheMDB message-driven bean cannot be activated because the mdb.test/TheMDB activation specification is not available. The message endpoint will not receive messages until the activation specification becomes available.

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:

http: //www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_jca_config_actspec.html

我不知道一种将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是否需要激活规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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