public void putOrder(String tempAddress) { try { int openOptions = MQC.MQOO_INPUT_AS_Q_DEF MQC.MQOO_OUTPUT; //Specify the queue that we wish to open, and the open options. MQQueue ncOrderDataQ = qMgr.accessQueue("NC.OrderCreateQ", openOptions, qManager, null, // no dynamic q name null); // no alternate user id
//Define a MQ message MQMessage customerAddress = new MQMessage();
customerAddress.writeUTF(tempAddress);
//specify the message options MQPutMessageOptions pmo = new MQPutMessageOptions();
//put the message on the queue ncOrderDataQ.put(customerAddress, pmo);
public String orderUpdateStatus() { String msgText = null; try { int openOptions = MQC.MQOO_INPUT_AS_Q_DEF MQC.MQOO_OUTPUT;
//Specify the queue that we wish to open, and the open options. MQQueue ncOrderUpdateQ = qMgr.accessQueue("NC.UpdateQ", openOptions, qManager, null, // no dynamic q name null); // no alternate user id
//create a new get the message MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = MQC.MQMI_NONE;
//set the get message options MQGetMessageOptions gmo = new MQGetMessageOptions();
//get the message off the queue ncOrderUpdateQ.get(retrievedMessage, gmo);
//Display the message msgText = retrievedMessage.readString(retrievedMessage.getMessageLength()); //for NC.UpdateQ
//Close the queue ncOrderUpdateQ.close(); } catch .........
public void performTask(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String returnMessage) {
try { // instantiate the bean BillingAddressBean myBillingAddressBean = new BillingAddressBean(); // set the return message in the bean myBillingAddressBean.setMQReturnMessage(returnMessage); // store the bean in the request so it can be accessed by pages which are accessed with callPage() ((com.sun.server.http.HttpServiceRequest)request).setAttribute ("BillingAddressBean", myBillingAddressBean); // Call the output page ((com.sun.server.http.HttpServiceResponse)response).callPage ("/AddressOutput