|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
PERL : MQSeries: Data in RFH2 Header |
« View previous topic :: View next topic » |
Author |
Message
|
herrman77 |
Posted: Thu Apr 19, 2012 10:58 pm Post subject: PERL : MQSeries: Data in RFH2 Header |
|
|
Newbie
Joined: 19 Apr 2012 Posts: 2
|
Hello,
I want to send Data in the RFH2 Header. My Data has to be located in the usr Folder of the RFH2 Header.
But now to my little Problem. I could not find Information to solve the Problem by myself.
I have to send three Data Values included in the usr folder of the RFH2 Header in MQ Series Messages.
I am able to create a message and send it to the Targetqueue. In the Messages received at the Targetqueue there is no data in the rfh2 Header.
I'm using Perl 5.8.8
I'm afraid the Datafields NameValueData and NameValueLength are not supported in the Perl Module MQSeries::Message::RFH2.
Is it correct, that i have to put my Information in want to transmit in the rfh2 HEader have to be located in the NameValueData?
Does Anybody know how to transmit Data in the rfh2 header via Perl API?
This is the Code Sample how i create the Message.
Code: |
use MQSeries;
use MQSeries::QueueManager;
use MQSeries::Queue;
use MQSeries::Message;
use MQSeries::Message::RFH2;
# Queue Connection
my $Q = MQSeries::Queue->new (
QueueManager => $qmgr,
Queue => $sendq,
Mode => 'output',
) || die $D->P("Unable to open queue.\n"); # Logging
# Message Creation
my $message = MQSeries::Message::RFH2->new(
MsgDesc => { CodedCharSetId => 819,
Format => 'MQHRF2',
ReplyToQ => $replyq,
ReplyToQMgr => $qmgr,
},
Header => {
StrucId => 'RFH',
Version => 2,
Struclength => 52,
Encoding => 819,
CodedCharSetId => 819,
Format => 'MQSTR',
Flags => 0,
NameValueCCSID => 1208,
NameValueData => $mqheader_data, # This is the XML Structure with my three Data Values
NameValueLength => $byte_size, # size of my Data in the Header
},
Data => $output,
) || die $D->P("Could not Create Message "); # Logging
$Q->Put(
Message => $message
) || die $D->P("Unable to put message onto queue.\n" . "CompCode = " . $Q->CompCode() . "\n" ."Reason = " . $Q->Reason() . "\n"); # Logging
|
# For Information This is how the xml Structur for NameValueData was created
my $mqheader_data = "<usr><ars_service>$ars_service</ars_service><persk>$personalnummer</persk><arsID>$ID</arsID></usr>";
I hope this is no stupid question or I wasn’t just to stupid to find the required Documentation. |
|
Back to top |
|
 |
Vitor |
Posted: Fri Apr 20, 2012 4:55 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you're using WMQv7 the RFH2 has been replaced by message properties. Depending on the compatability settings of the queue manager any RFH2 may have been automatically converted into properties.
As to how this all works in Perl, our resident Perl expert will be along in a minute. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 20, 2012 5:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
herrman77 |
Posted: Thu Apr 26, 2012 1:52 am Post subject: |
|
|
Newbie
Joined: 19 Apr 2012 Posts: 2
|
Thank You very much.
With the Hint about the Spaces in 'RFH ' i was able to create the RFH2 Header including my Data. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|