Hello,



I trying to put a large message on WMQ using MQ Java API and want it to be segmented. I only get

MQJE001: Completion Code 2, Reason 2010
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2010
at com.ibm.mq.MQQueue.put(MQQueue.java:1511)
at PutSegmentedMessageWithMqApi.main(PutSegmentedMess ageWithMqApi.java:54)




What is wrong?



Using a server-connection channel.



The code looks like:

public class PutSegmentedMessageWithMqApi {
public static final String QMGR_HOSTNAME = "192.168.197.128" ;
public static final int QMGR_PORT = 2414;
public static final String QMGR_CHANNEL = "java.channel" ;
public static final String QMGR_NAME = "WBRK6_DEFAULT_QUEUE_MANAGER" ;
public static final String QMGR_QUEUE = "ADTI.GLOPPS.OUT" ;
/**
* @param args
*/
public static void main(String[] args) {
try {
MQEnvironment.hostname = QMGR_HOSTNAME;
MQEnvironment.port = QMGR_PORT;
MQEnvironment.channel = QMGR_CHANNEL;

MQQueueManager queueManager = new MQQueueManager(QMGR_NAME);
MQQueue queue = queueManager.accessQueue(QMGR_QUEUE, MQC.MQOO_OUTPUT);
 
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_LOGICAL_ORDER;
 
MQMessage message = new MQMessage();
message.format = "MQSTR" ;
message.messageFlags = MQC.MQMF_SEGMENTATION_ALLOWED;
for ( int i = 1; i = 62000; i++) {
message.writeString( "K-10626-31 20070320 80321VO 21059248CHNGD NOTE 143PPL 0 00 \n" );
}
queue.put(message, pmo);
queue.close();
queueManager.disconnect();

} catch (Exception e) {
e.printStackTrace();
}
System.out.println( "Done" );
}
}


// 4 Integration