Author |
Message
|
goblue |
Posted: Mon Jun 29, 2009 1:40 pm Post subject: RFH2 header access using MQI C++ (w/o XMS) |
|
|
Newbie
Joined: 29 Jun 2009 Posts: 2
|
Hi,
I have read several posts on here concerning RFH2 headers and I know the recommended way to access it in C++ is to use XMS. However, we are too far ahead already using the native MQI C++ libraries to change gears and use the XMS libraries. I have seen several posting where the RFH2 was read/written using native java code (w/o jms), and I would like to do the same using C++, but hoping it should be easier considering the RFH2 struct is defined in cmqc.h. Does anyone have links or code snippets that may show how this is done?
My current guess on how this might look is:
Code: |
ImqQueue queue;
ImqMessage msg ;
MQRFH2 rfh2; /* as defined in cmqc.h */
if ( queue.get( msg ) ) {
/* Process all items of data in the message buffer. */
do while ( msg.dataLength( ) ) {
/* Determine if its a RFH2 header */
if (msg.formatIs( MQFMT_RF_HEADER_2)){
char *hBuffer = (char *)&rfh2;
if (msg.read(sizeof(rfh2), hBuffer)) {
...
...
|
Any help would be appreciated.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jun 29, 2009 1:49 pm Post subject: Re: RFH2 header access using MQI C++ (w/o XMS) |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
goblue wrote: |
hoping it should be easier considering the RFH2 struct is defined in cmqc.h. |
Note that the definition is only for the fixed portion of the header; you'll still have to build the variable section (with all the rules surrounding it) yourself.
goblue wrote: |
Does anyone have links or code snippets that may show how this is done? |
There's some sample code in the link at the top of the page, and more in with the server installation.
goblue wrote: |
My current guess on how this might look is: |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
goblue |
Posted: Mon Jun 29, 2009 3:32 pm Post subject: |
|
|
Newbie
Joined: 29 Jun 2009 Posts: 2
|
Quote: |
There's some sample code in the link at the top of the page, and more in with the server installation.
|
The sample code link does not seem to work for me. getting a "The page you requested cannot be displayed" error.
Can u point me to which server-side example code you are referring to?
Thanks |
|
Back to top |
|
 |
harish_td |
Posted: Mon Jun 29, 2009 6:28 pm Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
If you have MQ installed, the samples for C++ would be here
Quote: |
Win:C:\Program Files\IBM\WebSphere MQ\Tools\cplus\Samples
AIX: /usr/mqm/samp/
Linux:/opt/mqm/samp |
There are tons of sample programs posted by kind-hearted souls on the net. Some googling would help you get at it |
|
Back to top |
|
 |
smantrala |
Posted: Mon Jun 29, 2009 9:54 pm Post subject: |
|
|
Newbie
Joined: 29 Jun 2009 Posts: 3
|
harish_td wrote: |
If you have MQ installed, the samples for C++ would be here
Quote: |
Win:C:\Program Files\IBM\WebSphere MQ\Tools\cplus\Samples
AIX: /usr/mqm/samp/
Linux:/opt/mqm/samp |
There are tons of sample programs posted by kind-hearted souls on the net. Some googling would help you get at it |
All those "tons of sample programs" refer "tons of sample code" posts |
|
Back to top |
|
 |
|