| 发表于:2007-02-28 17:42:23 楼主 |
mqmessage msg = new mqmessage (); msg.report =mqc.mqro_copy_msg_id_to_correl_id; mqputmessageoptions pmo = new mqputmessageoptions (); //set put options pmo.options = mqc.mqpmo_new_msg_id + mqc.mqpmo_syncpoint ; msg.characterset =37; try { msg.writestring(strmsg); dataqueue.put(msg,pmo); system.out.println( "the strcorrid is: " + msg.correlationid.tostring() ); system.out.println( "the strmsgid is: " + msg.messageid.tostring() ); } catch(mqexception mqe) //if throws mqexceptions { system.err.println( "mq error while connecting to queue, reasoncode is " + mqe.reasoncode); } catch(exception e) { system.out.println( "error! " + e.tostring()); } 为什么每次产生的messageid、correlationid 都是相同的???? 产生的结果如下: the strcorrid is: [b@ef22f8 the strmsgid is: [b@1e0cf70 有什么地方需要设置吗?还是每次就是产生一样的??? 以上代码用java编写的~ |
|
|
|
|