Solved

MQRFH2 in MQ

Posted on 2006-10-25
2
2,012 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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.…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now