Create a message and put to a local queue

The following code constructs a message, adds a Unicode field with a value of "Hello World!" and the message is then put to the SYSTEM.DEFAULT.LOCAL.QUEUE on the local HelloWorldQM queue manager.
  public void put() throws Exception {
          System.out.println("Putting the test message");
          MQeMsgObject msg = new MQeMsgObject();

      // Add my hello world text to the message.
          msg.putUnicode("myFieldName" , "Hello World!");
          
          myQueueManager.putMessage(queueManagerName,
          MQe.System_Default_Queue_Name, msg, null, 0L);
          System.out.println("Put the test message");
      }

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.