Вопрос

I'm trying to use a message-driven bean in my webapp, but everytime it throws me this exception :

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.

After some researches, I've found out that the default limit is -1, so it has to be unlimited.

I've looked everywhere in Glassfish's admin console but withou finding a way to remove this limit. Even the "new JMS resource" wizard doesn't ask anything about this parameter.

Is there any way to fix it?

Это было полезно?

Решение

Why is your message so large? You might want to reconsider how you're doing this.

....

You can update it via the imqcmd command. The value you want to change is MaxBytesPerMsg.

From the SunGlassFish MessageQueue 4.4 Administration Guide or the 4.2 guide.

Updating Physical Destination Properties

The subcommand imqcmd update dst changes the values of specified properties of a physical destination:

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

The properties to be updated can include any of those listed in Table 18–1 (with the exception of the isLocalOnly property, which cannot be changed once the destination has been created).

For example, the following command changes the maxBytesPerMsg property of the queue destination curlyQueue to 1000 and the maxNumMsgs property to 2000:

imqcmd update dst -t q -n curlyQueue -u admin
                  -o maxBytesPerMsg=1000
                  -o maxNumMsgs=2000
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top