DataQueue class

The DataQueue class in the micro package (com.ibm.as400.micro.DataQueue) provides a modified subset of the functions available in the DataQueue class in the access package (com.ibm.as400.access.DataQueue). Use the DataQueue class to have your Tier0 device read from or write to a data queue on the iSeries™ server.

Note: To use ToolboxMe for iSeries classes, you must separately download and set up the ToolboxME for iSeries component.

The DataQueue class includes the following methods:

To read or write entries, you need to supply the name of the iSeries server where the data queue resides and the fully qualified integrated file system path name of the data queue. When no entries are available, reading an entry returns a null value.

Example: Using DataQueue to read from and write to a data queue

The following example demonstrates how to use the DataQueue class to read entries from and write entries to a data queue on an iSeries server:

   AS400 system = new AS400("mySystem", "myUserid", "myPwd", "myMEServer");
   try
   {
       // Write to the Data Queue.
       DataQueue.write(system, "/QSYS.LIB/FRED.LIB/MYDTAQ.DTAQ", "some text");
       
       // Read from the Data Queue.
       String txt = DataQueue.read(system, "/QSYS.LIB/FRED.LIB/MYDTAQ.DTAQ");
   }
   catch (Exception e)
   {
       // Handle the exception
   }
   // Done with the system object.
   system.disconnect();