解惑

解己之惑,解人之惑

控制Message Driven Bean的实例数

EJB2和EJB3的不一样,而且好像和容器提供商也有关,这里给出的是适用于EJB3和JBoss4的:
@MessageDriven(activationConfig = {
        @ActivationConfigProperty(
                propertyName = "destinationType",
                propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(
                propertyName = "destination",
                propertyValue = "queue/email"),
        @ActivationConfigProperty(
                propertyName = "maxSession",
                propertyValue = "1")})

关键的就是那个maxSession,它控制实例的最大个数。

(Visited 179 times, 1 visits today)

4 Comments

  1. 老刘,题目中有错字

  2. 呵呵,你怎么也学小胖的口气啊,我还以为是小胖呢

  3. 那怎么称呼你呢,难道叫你刘老,或者刘姥姥 :em20: :em20:

  4. 呵呵,还是叫老刘好了 :em35:

发表评论

邮箱地址不会被公开。 必填项已用*标注

© 2024 解惑

本主题由Anders Noren提供向上 ↑