问题描述
与这位楼主一模一样的问题,也不知道他怎么解决的,哪位大神知道解决方案http://bbs.csdn.net/topics/190046875之前是在旧版本的websphere用C程序实现的索引消息传输文件,现在要在8.0版本用java实现.C版本大致如下:MQODod={MQOD_DEFAULT};/*ObjectDescriptor*/MQMDmd={MQMD_DEFAULT};/*MessageDescriptor*/MQPMOpmo={MQPMO_DEFAULT};/*putmessageoptions*/MQGMOgmo={MQGMO_DEFAULT};/*getmessageoptions*/MQRMHXrefx={{MQRMH_DEFAULT}};/*referencemessage*/MQHCONNHcon;/*connectionhandle*/MQHOBJHobj=MQHO_UNUSABLE_HOBJ;/*objecthandle*/MQLONGCompCode;/*completioncode*/MQLONGConnCode;/*MQCONNcompletioncode*/MQLONGReason;/*reasoncode*/MQLONGCReason;/*reasoncodeforMQCONN*/MQLONGco=MQCO_NONE;/*MQCLOSEoptions*/MQLONGDataLength;/*Lengthofreportmessage*/MQLONGWaitInterval=15;/*Waitinterval*/MQLONGQMgrCCSID;/*QMgrCodedCharSetId*/PMQRMHpMQRMH;/*->MQRMHstructure*/PMQXQHpMQXQH;/*->MQXQHstructure*/charQMName[MQ_Q_MGR_NAME_LENGTH+1]="qmgrname";/*localqueuemanagername*/charDestQName[MQ_Q_NAME_LENGTH+1]="queuename";/*destinationqueuename*/charSourceFileName[MAX_FILENAME_LENGTH+1]="filename";/*sourcefilename*/charTargetFileName[MAX_FILENAME_LENGTH+1]="filename";/*targetfilename*/charObjectType[sizeof(refx.ref.ObjectType)];/*Objecttype*/charBuffer[sizeof(MQXQH)+MAX_MQRMH_LENGTH];strcpy(QMName,sMQManager);strcpy(DestQName,sMQSendQueue);strcpy(SourceFileName,sFileName);sprintf(SourceFileName,"%s\%s",getenv("MQ_FILEPATH"),sFileName);//源文件名strcpy(TargetFileName,sFileName);sprintf(errorstr,"QMName=[%s],DestQName=[%s],SourceFileName=[%s]nn",QMName,DestQName,SourceFileName);MQCONN(QMName/*queuemanager*/,&Hcon/*connectionhandle*/,&ConnCode/*completioncode*/,&CReason);/*reasoncode*/CompCode=ConnCode;memset(ObjectType,'',sizeof(ObjectType));memcpy(ObjectType,"FLATFILE",sizeof("FLATFILE")-1);refx.ref.StrucLength=sizeof(refx);refx.ref.Encoding=MQENC_NATIVE;refx.ref.CodedCharSetId=QMgrCCSID;memcpy(refx.ref.Format,MQFMT_STRING,(size_t)MQ_FORMAT_LENGTH);refx.ref.Flags=MQRMHF_LAST;memcpy(refx.ref.ObjectType,ObjectType,sizeof(refx.ref.ObjectType));memset(refx.SrcName,'',sizeof(refx.SrcName)+sizeof(refx.DestName));memcpy(refx.SrcName,SourceFileName,strlen(SourceFileName));memcpy(refx.DestName,TargetFileName,strlen(TargetFileName));refx.ref.SrcNameLength=strlen(SourceFileName);refx.ref.SrcNameOffset=offsetof(MQRMHX,SrcName);refx.ref.DestNameLength=strlen(TargetFileName);refx.ref.DestNameOffset=offsetof(MQRMHX,DestName);memcpy(md.ReplyToQ,"QUEUE_REPORT",strlen("QUEUE_REPORT"));strncpy(od.ObjectName,DestQName,sizeof(od.ObjectName));md.Report=MQRO_COA_WITH_FULL_DATA+MQRO_EXCEPTION_WITH_FULL_DATA;pmo.Options=MQPMO_FAIL_IF_QUIESCING;memcpy(md.Format,MQFMT_REF_MSG_HEADER,(size_t)MQ_FORMAT_LENGTH);MQPUT1(Hcon,/*connectionhandle*/&od,/*objectdescriptorforqueue*/&md,/*messagedescriptor*/&pmo,/*options*/sizeof(refx),/*bufferlength*/&refx,/*buffer*/&CompCode,/*MQPUT1completioncode*/&Reason);/*reasoncode*/
在线等~~~~~
解决方案
解决方案二:
顶一下
解决方案三:
顶一下