ejb-jar.xml中設置maxsession爲MDB我想配置maxsession爲MDB 所以沒有對MDB類通過JBoss的
@ActivationConfigProperty(propertyName="maxSession",propertyValue="6")
片段
@MessageDriven
(activationConfig =
{
@ActivationConfigProperty(propertyName = "acknowledgeMode",
propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination",
propertyValue = "queue/MyQueue"),
@ActivationConfigProperty(propertyName = "reconnectAttempts",
propertyValue = "-1"),
@ActivationConfigProperty(propertyName = "setupAttempts",
propertyValue = "-1"),
@ActivationConfigProperty(propertyName="maxSession",propertyValue="6")
},
mappedName = "MyQueue"
)
一個下面的註釋並且我已經在ejb-jar.xml中配置了maxsession
<?xml version='1.0' encoding='UTF-8'?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0">
<enterprise-beans>
<message-driven>
<ejb-name>MDBBean</ejb-name>
<ejb-class>com.mybean.MDBBean</ejb-class>
<messaging-type>javax.jms.MessageListener</messaging-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>maxSession</activation-config-property-name>
<activation-config-property-value>20</activation-config-property-value>
</activation-config-property>
<activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>
<activation-config-property-value>queue/MyQueue</activation-config-property-value>
</activation-config-property>
<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>
</message-driven>
</enterprise-beans>
</ejb-jar>
AFAIK優先顯示給予ejb-jar.xml然後註釋。
但是當我通過JMX控制檯檢查「ConsumerCount」這表明26 這意味着它增加了兩個值。 如果我除去@ActivationConfigProperty(propertyName的= 「maxSession」,=的PropertyValue 「6」)形式cclass文件時,它顯示了35(即默認15,然後將其從ejb-jar.xml中添加20)
我的要求是,它應該只從ejb-jar.xml中選擇值。 注意:我不想刪除類中的註釋,因爲在另一個AS上使用相同的代碼。
JBoss AS中6和內部@happy我試着用AS 6過於它使用HornetQ的 – happy
。它顯示了ejb-jar.xml中定義的'ConsumerCount'值。這是MBean我引用'org.hornetq:module = JMS,type = Queue,name =「$ QUEUE_NAME」' – Varsha