jmspayaraasadmin

Setting the Maximum Message Size for JMS Destinations in Payara


We are using a Payara Server Version 5 and 6 on which we have several JMS Destinations configured. These are configured via the asadmin command line tool like so:

./asadmin --Port=4848 create-jms-resource 
--resType=javax.jms.Queue
--property=Name=lokal.test
--force=false 
--enabled=true jms/transport/test

I now have the problem that I need to configure the Maximum Message Size for this JMS destination because the default value is too small. (Default on payara is 10MB) This should be done with the asadmin command line tool. Using the GUI is not an option because I need to automate the behavior.

I already tried setting the property MaxBytesPerMsg to -1 (unlimited) to try this out. (According to https://javaee.github.io/glassfish/doc/5.0/reference-manual.pdf Page 137) This however did nothing even after restarting the payara. The value was still set to 10MB.

Using the imqcmd (https://docs.oracle.com/cd/E19253-01/816-5166/6mbb1kq38/index.html) could be possible but would be a problem because we would need to deploy this tool on multiple servers.

I expect that there is some possibility to set this property using the asadmin tool especially using the properties of the JMS destination similar to this: set resources.admin-object-resource.jms/transport/test.property.MaxBytesPerMsg=-1

However I can't seem to find the appropriate property name.

Does anyone know of a way to do this using the asadmin command line tool? Any help would be greatly appreciated!


Solution

  • Since, sadly, no one could help me out here, I found a workaround that might help someone out who is struggling with a similar issue.

    I did not find any possibility to set this property using asadmin commands. Instead I was able to write the property into a specific file in the domain folder to set the property.

    Just go to ../<domainFolder>/<domainName>/imq/instances/imqbroker/props and open the config.properties file. At the end of the file you can add imq.autocreate.destination.maxBytesPerMsg=80M to, for example, set the maximum bytes per Message to 80 MB for all JMS Queues.

    This file and directory are only automatically created after the domain was first started and one should probably only write into the file once the domain is no longer running to avoid problems. Writing the property into this file works on both Windows Systems as well as Linux.

    In my case I just implemented this in our domain-setup tool, which now writes into the config.properties file after configuring, starting and stopping the domain.

    I know this is not the most elegant solution but at least it works. Should anyone knows how to set this using asadmin commands I would still really appreciate it!