Solved

MQRFH2 in MQ

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

19 Experts available now in Live!

Get 1:1 Help Now