

- #Clear queue java update#
- #Clear queue java software#
- #Clear queue java code#
- #Clear queue java download#
#Clear queue java update#
#Clear queue java software#
IBM Software Support Proactive Lifecycle update - October 2023 October 2, 2023.
#Clear queue java code#

IT42974: An MQ Managed File Transfer (MFT) agent reports a NullPointerException in its event log (output0.log) October 6, 2023.MQClearQueue01.logger("Usage: java MQClearQueue01 -m QueueManagerName -h host -p port -c channel -q QueueName -u UserID -x Password") MQClearQueue01 mqcq = new MQClearQueue01() (LOGGER_TIMESTAMP.format(new Date())+" "+className+": "+Thread.currentThread().getStackTrace().getMethodName()+": "+data) If ( (className != null) & (className.lastIndexOf('.') != -1) )ĬlassName = className.substring(className.lastIndexOf('.')+1) String className = Thread.currentThread().getStackTrace().getClassName() MQClearQueue01.logger("disconnected from "+ qMgrName) MQClearQueue01.logger("disconnected from agent") MQClearQueue01.logger("Error: Failed to clear queue '"+queueName+"' of messages.

If ( (e.completionCode = CMQC.MQCC_FAILED) & (e.reasonCode = CMQCFC.MQRCCF_OBJECT_OPEN) ) MQClearQueue01.logger("IOException:" +e.getLocalizedMessage()) MQClearQueue01.logger("CC=" +e.completionCode + " : RC=" + e.reasonCode + " ") MQClearQueue01.logger("Error: Failed to clear queue '"+queueName+"' of messages.") MQClearQueue01.logger("Successfully cleared queue '"+queueName+"' of messages.") If ((responses).getCompCode() = CMQC.MQCC_OK) MQClearQueue01.logger("responses.length="+responses.length) įor (int i = 0 i < responses.length i++) Request.addParameter(CMQC.MQCA_Q_NAME, queueName) Request = new PCFMessage(CMQCFC.MQCMD_CLEAR_Q) MQClearQueue01.logger("successfully created agent") MQClearQueue01.logger("successfully connected to "+ qMgrName) QMgr = new MQQueueManager(qMgrName, mqht) String queueName = (String) params.get("-q") String qMgrName = (String) params.get("-m")

* looping through PCF response messages and disconnecting from * Handle connecting to the queue manager, issuing PCF command then I don't want to see MQ exceptions at the console. Mqht.put(CMQC.PASSWORD_PROPERTY, params.get("-x")) Mqht.put(CMQC.USER_ID_PROPERTY, params.get("-u")) Mqht.put(CMQC.PORT_PROPERTY, new Integer(port)) Mqht.put(CMQC.HOST_NAME_PROPERTY, params.get("-h")) Mqht.put(CMQC.CHANNEL_PROPERTY, params.get("-c")) Port = Integer.parseInt((String) params.get("-p")) If (args.length > 0 & (args.length % 2) = 0) Private void init(String args) throws IllegalArgumentException * Extract the command-line parameters and initialize the MQ HashTable. Integer.parseInt((String) params.get("-p")) * Make sure the required parameters are present.īoolean b = ntainsKey("-h") & ntainsKey("-p") & Private static final SimpleDateFormat LOGGER_TIMESTAMP = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS") * Note: The PCF "Clear Q" command will fail if an application has the queue open. * in the queue of a remote queue manager. * This java class issues a PCF "Clear Q" command for a queue to delete all messages Note: The PCF “Clear Queue” command will fail if an application has the queue open.įor more information about the PCF “Clear Queue” command, go to MQ KnowLedge Center here.
#Clear queue java download#
You can download the source code from here. If you have done the following runmqsc command to clear a queue: CLEAR QLOCAL( )Īnd you wanted to do the same thing via a program, here is a fully functioning Java MQ example that will connect to a remote queue manager, issue a PCF “Clear Queue” command, get the PCF response messages and output if the PCF command was successful or not.
