use Win32::OLE;
&sendInbox("Body",'MSMQ-Server\private$\test');
sub sendInbox()
{
    my $Body = shift;
    my $Queue = shift;
    my $sendMsg = Win32::OLE->new('MSMQ.MSMQMessage');
    my $sendInfo = Win32::OLE->new('MSMQ.MSMQQueueInfo');
    my $Sendxdisper = Win32::OLE->new('MSMQ.MSMQTransactionDispenser'); #
    my $Sendxact = Win32::OLE->new('MSMQ.MSMQTransaction'); #
    $Sendxact = $Sendxdisper->BeginTransaction(); 
    $sendInfo->{FormatName}= "direct=os:" . $Queue;
    my $sendQ = $sendInfo->Open(2, 0);
    $sendMsg->{Label}= "Label";
    $sendMsg->{Body}= $Body;
    #Send Message
    $sendMsg->Send($sendQ,$Sendxact);
    $sendQ->Close;
    $Sendxact->Commit();
}
|  Custom Search | 
PayPal is the easiest way to receive money online.  Get one now or Click here to sign up.
 
How to send message in transactional MSMQ queue using perl
Labels:
Message,
MSMQ,
Perl,
Queuing,
Transactional
WebProNews Feed
|  Custom Search | 
eWeek - RSS Feeds
HowtoForge - Howtos and Tutorials
The Register
PayPal is the easiest way to receive money online.  Get one now or Click here to sign up.
 

 
No comments:
Post a Comment