Author |
Message
|
nik_iway |
Posted: Sun Dec 04, 2005 10:47 pm Post subject: MQMD Options |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
hi Everybody,
I am using MQ Series v 5.3 Client on Mainframes and the MQ Server is on Unix. I want to send the File path and Inteface ID (the Application which is talking ot the MQ server )as the parameters in the MQMD. Are there any feilds in MQMD which i can refer to
Thanking you
Regards
Nik |
|
Back to top |
|
 |
Mr Butcher |
Posted: Sun Dec 04, 2005 11:48 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
afaik there is no client for the mainframe, so maybe it is the other way round (client on unix, server on maingrame) ?!?
there is already a field in the md that holds the application name (check the putapplname and putappltype) that are filled by mq but which you can also set (depending on your context settings).
check with application programmers guide and application programmers reference. _________________ Regards, Butcher |
|
Back to top |
|
 |
nik_iway |
Posted: Sun Dec 04, 2005 11:54 pm Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
Hi Mr.Butcher
Thanks for the reply, IS there any feild in the MQMD where i can pass the path of the file that i am Accesing and putting the message. I am reading the contents of the file from c:\test\request.txt. can i specify that path c:\test\request.txt in the MQMD, is there a way
Regards
Nik |
|
Back to top |
|
 |
Tibor |
Posted: Mon Dec 05, 2005 12:16 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Nik,
Because of MQMD is for internal usage I recommend you the MQRFH2 header for placing *any* additional information.
HTH,
Tibor |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Dec 05, 2005 12:34 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
sorry, i did not read that you want to send the filename....
i go with tibor, do not use the MD for application data. _________________ Regards, Butcher |
|
Back to top |
|
 |
nik_iway |
Posted: Mon Dec 05, 2005 1:36 am Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
Hi Tobor,
CAn you please send me how to create a MQRFH2 header and
pass the File path Paramater to it
Regards
Nik |
|
Back to top |
|
 |
nik_iway |
Posted: Mon Dec 05, 2005 1:56 am Post subject: |
|
|
Centurion
Joined: 21 Jul 2005 Posts: 115
|
Tibor,
I am using MQ Base Java classes for putting the Message
My Code is as Below :
import com.ibm.mq.*;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.MQException;
import java.text.*;
import java.io.*;
import java.util.*;
import java.lang.StackTraceElement;
public class MQPUT
{
Properties properties = new Properties();
public void pushq()
{
try
{
// Load system properties from file
FileInputStream pfis = new FileInputStream("C:\\test\\properties.ini");
properties.load(pfis);
pfis.close();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
properties.list(new PrintStream(baos));
System.out.println(baos.toString());
// Prepare MQ Series environment
String SrvChannel = properties.getProperty("CHANNEL_NAME");
String Host = properties.getProperty("HOST_NAME");
int qmgrprt = Integer.parseInt(properties.getProperty("PORT"));
String qmgr = properties.getProperty("QUEUE_MANAGER");
String requestqueue = properties.getProperty("REQUEST_QUEUE");
String replyqueue = properties.getProperty("REPLY_QUEUE");
String userid = properties.getProperty("USER_ID");
String pwd = properties.getProperty("PWD");
// Populating the MQ Environmental Variables
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
// The Host Name to which the MQClient Connects To
MQEnvironment.hostname = Host;
// The Port Number the MQ Client Connects To
MQEnvironment.port = qmgrprt;
//The name of the Server Connection Channels
MQEnvironment.channel = SrvChannel;
// User ID of the MQ Client Accessing the MQServer
MQEnvironment.userID = userid;
// Password of the MQ Client Accessing the MQServer
MQEnvironment.password = pwd;
//The Queue Manager the MQ Client Connects to
System.out.println("Accessing the QueueManager: " +qmgr);
MQQueueManager qMgr1 = new MQQueueManager(qmgr);
// Open the Queue Manager
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INQUIRE |MQC.MQOO_SET;
//The Queue on which the Request Message is PUT
System.out.println("Accessing the Request Queue : " +requestqueue);
MQQueue queue = qMgr1.accessQueue(requestqueue, openOptions, null, null, null);
openOptions = MQC.MQOO_INPUT_EXCLUSIVE + MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING;
// Message Options
MQMessage requestmessage = new MQMessage();
requestmessage.format = MQC.MQFMT_STRING ;
requestmessage.messageFlags = MQC.MQMT_REQUEST ;
// MQPUT Message Otions
MQPutMessageOptions pmo = new MQPutMessageOptions();
// puts the Message with a Unique Message ID
String requestmessageId = "RQST";
requestmessage.messageId = requestmessageId.getBytes();
System.out.println("Message ID of Request Message is : " + requestmessageId);
System.out.println(requestmessage.messageId);
// Message picked from the File
FileInputStream fis = new FileInputStream("c:\\request.txt");
int x= fis.available();
byte b[]= new byte[x];
fis.read(b);
String content = new String(b);
// Request Message written as a String
requestmessage.writeString(content);
//Message written to the REQUEST QUEUE
queue.put(requestmessage, pmo);
// COMMIT by the Queue Manager
qMgr1.commit();
// REQUEST QUEUE CLOSE
queue.close();
// File Closed
fis.close();
// QUEUE MANAGER DISCONNECTED
qMgr1.disconnect();
}
catch(MQException mqe)
{
mqe.printStackTrace();
}
catch (Exception exc)
{
exc.printStackTrace();
}
}
public static void main(String args[])
{
MQPUT Request = new MQPUT();
Request.pushq();
}
}
Can you please tell me how to add the MQRFH2 header and pass the File PATH Name
I have an Interface ID WE32ID that needs to be passsed to the server how can i add it to the MQRFH2 Header
Thanking you and Regards
Nik |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Dec 06, 2005 8:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
When you use the MQRFH header it is really much more easy if you use JMS instead of MQ base java. This will avoid you much headache.
In other languages see about the C base XMS support pack.
Enjoy  |
|
Back to top |
|
 |
|