【问题标题】:Glassfish Message-Driven bean message sizeGlassfish 消息驱动的 bean 消息大小
【发布时间】:2012-05-12 06:17:51
【问题描述】:

我正在尝试在我的 web 应用程序中使用消息驱动的 bean,但每次它都会抛出这个异常:

com.sun.messaging.jmq.jmsserver.util.BrokerException: [B4122]: Can not add message 1-127.0.1.1(b0:1a:c1:66:46:a9)-1-1336769823653 to destination PhysicalQueue [Queue]. The message size of 24968685 bytes is larger than the destination individual message byte limit (maxBytesPerMsg) of 10485760 bytes.

经过一番研究,我发现默认限制是-1,所以它必须是无限的。

我在 Glassfish 的管理控制台中到处查看,但没有找到消除此限制的方法。 甚至“新 JMS 资源”向导也不会询问有关此参数的任何内容。

有什么办法可以解决吗?

【问题讨论】:

    标签: glassfish glassfish-3 message-driven-bean


    【解决方案1】:

    为什么你的消息这么大?您可能需要重新考虑如何执行此操作。

    ....

    您可以通过imqcmd 命令对其进行更新。您要更改的值是 MaxBytesPerMsg。

    来自SunGlassFish MessageQueue 4.4 Administration Guide4.2 guide

    更新物理目的地属性

    子命令 imqcmd update dst 更改物理的指定属性的值 目的地:

    imqcmd update dst -t destType -n destName
                       -o property1=value1 [ [-o property2=value2] ... ]
    

    要更新的属性可以包括表 18–1 中列出的任何属性(除了 isLocalOnly 属性,一旦创建目标就无法更改)。

    例如,以下命令更改队列的 maxBytesPerMsg 属性 将目标 curlyQueue 设置为 1000,将 maxNumMsgs 属性设置为 2000:

    imqcmd update dst -t q -n curlyQueue -u admin
                      -o maxBytesPerMsg=1000
                      -o maxNumMsgs=2000
    

    【讨论】:

    • 我想问题比它看起来的要大。我只有一个List 2 个字符串!怎么会这么大?
    • 您必须发布构建消息的代码。但这是一个不同的问题:)
    猜你喜欢
    • 1970-01-01
    • 2014-01-12
    • 1970-01-01
    • 2011-07-15
    • 1970-01-01
    • 1970-01-01
    • 2017-06-13
    • 2011-01-28
    • 2013-03-17
    相关资源
    最近更新 更多