Когда сервер запускается, я вижу, что он проверяет сообщения, но иногда он больше не пытается захватить сообщения.
Я не контролировал это так близко, чтобы знать точное время, но я знаю, что он даже не пытается проверить, потому что у меня это в режиме отладки, и я вообще не вижу команд сообщения; Кроме того, сообщения, помещенные в очередь, не обрабатываются обработкой сообщений.
Вот мой ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar id="ejb-jar_ID"
version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<display-name>MessageEJB</display-name>
<enterprise-beans>
<message-driven>
<display-name>MessageBean</display-name>
<ejb-name>MessageBean</ejb-name>
<ejb-class>com.ecomm.ejb.mdb.MessageBean</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<transaction-type>Container</transaction-type>
<message-destination-type>javax.jms.Queue</message-destination-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>/queue/ExpiryQueue</activation-config-property-value>
</activation-config-property>
</activation-config>
</message-driven>
</enterprise-beans>
И jboss.xml:
<?xml version="1.0"?>
<jboss>
<enterprise-beans>
<message-driven>
<ejb-name>MessageBean</ejb-name>
<destination-jndi-name>/queue/ExpiryQueue</destination-jndi-name>
<resource-ref>
<res-ref-name>MessageBean</res-ref-name>
<jndi-name>/queue/ExpiryQueue</jndi-name>
</resource-ref>
</message-driven>
</enterprise-beans>
</jboss>
И ejb:
/**
* Message-Driven Bean implementation class for: MeaageBean
*
*/
@MessageDriven(
mappedName = "/queue/ExpiryQueue",
activationConfig = {
@ActivationConfigProperty(
propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"
),
@ActivationConfigProperty(
propertyName = "destinationType",
propertyValue = "javax.jms.Queue"
)
}
)
public class MessageBean implements MessageListener {