Solved

MQRFH2 in MQ

Posted on 2006-10-25
2
2,109 Views
Last Modified: 2013-12-11
Hi,

The links in the below question seems to be obsolete.
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20139855.html?query=MQRFH2&clearTAFilter=true

Could anyone send a sample code to insert MQRFH2 to MQMessage using java?
I am trying build <usr> and <jms> folders.
I tried few examples but it is not adding to the header..instead the message body contains the added text.


0
Comment
Question by:pattabi23in
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
rama_krishna580 earned 500 total points
ID: 17808671
Here is the sample code...
Posted: Tue Mar 22, 2005 8:51 am    Post subject: problem with setting RFH2 header in java  

--------------------------------------------------------------------------------
 
I have the following code snippet to set RFh2 header in java.

However, when I view the message in MQ visual browse, its is not being deciphered as RFH2 header. What am i missing?

Also, I counted the bytes and it should be 36 bytes in RFH2 I am setting, but when I do the length of the message - it displays that the length is 60.
The message has nothing but RFH2 structure.

Any help is appreciated.

--------------------------------------------------------------------------------
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |
MQC.MQOO_OUTPUT ;
MQQueue test_queue = qMgr.accessQueue("Q_ECM_TEST_CHAT",openOptions);
MQMessage test = new MQMessage();
test.writeString("RFH "); // String rfhStrucID
test.writeLong(2); //version
test.writeLong(36); //rfhStrucLength
test.writeLong(273); //encoding
test.writeLong(819); //codedCharacterSetID
test.writeString("MQSTR "); //rfhFormat
test.writeLong(0); //rfhFlags
test.writeLong(1208); //rfhNameValueCCSID

int len = test.getMessageLength();
System.out.println("len of msg = " + len);


MQPutMessageOptions pmo = new MQPutMessageOptions();

test_queue.put(test, pmo);

test_queue.close();
qMgr.disconnect();

http://www.mqseries.net/phpBB2/viewtopic.php?t=23331&view=next&sid=ba37be876e909a1d946dc44d8a42cff9

R.K
0
 

Author Comment

by:pattabi23in
ID: 17811559
Whew!!!!! Thank you very much. It worked very well.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question