[V9.1.5 Apr 2020][UNIX, Linux, Windows, IBM i]

Changing the size of an IBM MQ queue file

You can increase or decrease the maximum size of a queue file.

Before you begin

Before setting a new size for a queue file, use the DISPLAY QLOCAL command to see the size of the queue file you want to change. For example, issue the following command:
DISPLAY QLOCAL(SYSTEM.DEFAULT.LOCAL.QUEUE) MAXFSIZE
You receive the following output:

AMQ8409I: Display queue details
  QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE)        TYPE(QLOCAL)
  MAXFSIZE(DEFAULT)

which shows that the maximum size of the queue file is the default value of 2,088,960 MB.

About this task

The following procedures show you how to:
  • Reduce the maximum size that a queue file can grow to.
  • Increase the maximum size that a queue file can grow to.
    Attention: You should be cautious of increasing the size of queue files without considering the way that your applications are written and the possible effect on performance. Accessing messages at random in a very large queue file can be very slow.

    If you are considering increasing the maximum size of a queue file beyond the default you should be cautious of using message selectors such as correlation IDs and IBM® MQ classes for JMS selector strings. Larger queue files are better suited to first-in first-out access to the queue.

    Having very large amounts of data in individual queue files should only be done on queue managers that are configured for circular logging, or where media imaging has not been enabled for the individual queue.

    You should not limit the size of SYSTEM queues as this could affect the operation of the queue manager.

Procedure

  1. Reduce the maximum queue file size
    1. Issue the following command to create a local file called SMALLQUEUE, with a size of 500 gigabytes :
      
      DEFINE QLOCAL(SMALLQUEUE) MAXFSIZE(512000)
           2 : DEFINE QLOCAL(SMALLQUEUE) MAXFSIZE(512000)
      AMQ8006I: IBM MQ queue created  
      and you receive message: AMQ8006I:
      Note: If you configure a queue with a value smaller than the amount of data already in the file, new messages cannot be put to the queue.

      If an application attempts to put a message to a queue file that does not have sufficient space, the application receives the return code MQRC_Q_SPACE_NOT_AVAILABLE. When enough messages are destructively read from the queue, applications can begin to put new messages to the queue.

  2. Increase the maximum queue file size.
    1. Issue the following command to create a local file called LARGEQUEUE, with a size of 5 terabytes:
      
      DEFINE QLOCAL(LARGEQUEUE) MAXFSIZE(5242880)
           3 : DEFINE QLOCAL(LARGEQUEUE) MAXFSIZE(5242880)
      AMQ8006I: IBM MQ queue created