Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MQRFH2 in MQ

Posted on 2006-10-25
2
Medium Priority
?
2,309 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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