【问题标题】:how do i set the pool size of message driven beans in tomee?如何在 tomee 中设置消息驱动 bean 的池大小?
【发布时间】:2014-02-07 17:38:40
【问题描述】:

我的 TomEE 1.6.0 应用中有 3 种类型的 MDB。

我想将其中一个的最大池大小设置为某个值,而不影响其他的。

Tomee 文档提供了有关如何设置 EJB 类型 (http://tomee.apache.org/containers-and-resources.html) 的说明,例如

<Container id="Foo" type="MESSAGE">
    InstanceLimit 10
</Container>

但不适用于特定的 MDB。

我该怎么做?

【问题讨论】:

    标签: ejb message-driven-bean apache-tomee


    【解决方案1】:

    假设你的不同类型的MDB有不同的接口。 然后可以分别定义多个不同ID的MDB Container。

    例子:

    <Container id="TypeA" type="MESSAGE">
        InstanceLimit 10
        messageListenerInterface your.interface.typeA
    </Container>
    <Container id="TypeB" type="MESSAGE">
        InstanceLimit 8
        messageListenerInterface your.interface.typeB
    </Container>
    

    【讨论】:

    • 消息监听接口通常是 javax.jms.MessageListener 。可以是扩展它的任何接口吗?
    • 尝试使用@MessageDriven(messageListenerInterface=...)
    猜你喜欢
    • 1970-01-01
    • 2017-06-13
    • 1970-01-01
    • 2013-05-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-12
    相关资源
    最近更新 更多