Websphere Liberty如何使MDB侦听器正常工作?

时间:2019-05-08 07:23:06

标签: websphere websphere-liberty mq message-driven-bean

我正在尝试使MDB侦听器在Websphere Liberty v16.0.0.4中工作,但是在messages.log中没有收到消息,表明需要使用MDB侦听器的应用程序已绑定到激活规格。

我有以下信息:

QueueManager: TEST  
Hostname: localhost  
Default ServerConnectionChannel: BAN.TEST.T1   
Portnumber: 5704

Queue Connection Factory:  
JndiName: jms/dbd_pega_CNVBANQCF  
Type TCF/QCF/CF: QCF  
ServerConnectionChannel: BAN.TEST.T1  

Queue 1:  
JndiName: jms/dbd_pega_CNVBAN_ReqQ  
queueName: SRV00026.201206.BAN  

Queue 2:  
JndiName: jms/dbd_pega_CNVBAN_RplQ  
queueName: BAN.RPL.BAN   

Activation Specification:  
JNDI Activation Specification: eis/dbd_pega_cnvbanQAS  
Name Activation Specification: dbd_pega_cnvbanQAS  
The JNDI name of the Destination Queue: jms/dbd_pega_CNVBAN_ReqQ

MDB侦听器称为CnvMQIbanServices.jar,并放在名为prpc_j2ee14_ws.ear的耳朵文件中。

这是我的server.xml

<xml version="1.0" encoding="UTF-8">
<server description="server">
<featureManager>
<feature>webProfile-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>jdbc-4.1</feature>
<feature>ssl-1.0</feature>
<feature>servlet-3.1</feature>
<feature>ejb-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>ejbRemote-3.2</feature>
<feature>jndi-1.0</feature>
<feature>jms-2.0</feature>
<feature>jaxws-2.2</feature>
<feature>jaxb-2.2</feature>
<feature>restConnector-2.0</feature>
<feature>wmqJmsClient-2.0</feature>
<feature>jmsMdb-3.2</feature>
</featureManager>
<applicationManager autoExpand="true"/>
<jmsQueueConnectionFactory jndiName="jms/dbd_pega_CNVBANQCF" connectionManagerRef="ConMgr6">
<properties.wmqJms
transportType="CLIENT"
hostName="localhost"
port="5704"
channel="BAN.TEST.T1"
queueManager="TEST"/>
</jmsQueueConnectionFactory>
<connectionManager id="ConMgr6" maxPoolSize="2"/>
<jmsQueue id="jms/dbd_pega_CNVBAN_ReqQ" jndiName="jms/dbd_pega_CNVBAN_ReqQ">
<properties.wmqJms
baseQueueName="SRV00026.201206.BAN"
baseQueueManagerName="TEST"/>
</jmsQueue>
<jmsQueue id="jms/dbd_pega_CNVBAN_RplQ" jndiName="jms/dbd_pega_CNVBAN_RplQ">
<properties.wmqJms
baseQueueName="BAN.RPL.BAN"
baseQueueManagerName="TEST"/>
</jmsQueue>
<jmsActivationSpec id="prpc_j2ee14_ws/CnvMQIbanServices.jar/CnvMQIbanServices_J2CMessageEndpoint">
<properties.wmqJms
transportType="CLIENT"
destinationRef="jms/dbd_pega_CNVBAN_ReqQ"
destinationType="javax.jms.Queue"
hostName="localhost"
port="5704"
channel="BAN.TEST.T1"
queueManager="TEST"/>
</jmsActivationSpec>
</server>

如果将MDB侦听器导入Websphere Application Server中的应用程序中,我知道我需要将MDB Listener.jar文件绑定到激活规范,因此在这种情况下,请将CnvMQIbanServices.jar绑定到eis / dbd_pega_cnvbanQAS,我错过了这个,但是我怎么需要把它放在server.xml中呢?也许我还想念其他东西吗?

1 个答案:

答案 0 :(得分:0)

为了确定您是否为jmsActivationSpec id使用了正确的值,请在启动服务器后查看messages.log文件中的警告,例如以下内容,

com.ibm.ws.ejbcontainer.mdb.internal.MDBRuntimeImpl          W CNTR4015W: The message endpoint for the {MDB_NAME} message-driven bean cannot be activated because the {ACTIVATION_SPEC_NAME} activation specification is not available. The message endpoint will not receive messages until the activation specification becomes available.

使用您在{ACTIVATION_SPEC_NAME}中看到的值作为jmsActivationSpec ID值。