ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Problems reading messages from MQ

Post new topic  Reply to topic
 Problems reading messages from MQ « View previous topic :: View next topic » 
Author Message
rchiroldes
PostPosted: Thu Jun 12, 2008 1:04 pm    Post subject: Problems reading messages from MQ Reply with quote

Newbie

Joined: 12 Jun 2008
Posts: 2

Hi! Dudes,

I have a C# application using AMQMDNET.DLL API for putting messages in remote queues defined in one host/server. My code looks like this:

public override int SendDataToHost(string msg)
{
MQQueueManager mqQMgr; // MQQueueManager instance
MQQueue mqQueue1; // MQQueue instance
MQMessage mqMsg; // MQMessage instance
MQPutMessageOptions mqPutMsgOpts; // MQPutMessageOptions instance

IBM.WMQ.MQEnvironment.Channel = this.mqsconfig.MQSCHANNELNAME;
IBM.WMQ.MQEnvironment.Hostname = this.mqsconfig.MQSCONNECTIONNAME;
IBM.WMQ.MQEnvironment.Port = this.mqsconfig.MQSTCPPORT;

try
{
//mqQMgr = new MQQueueManager(this.mqsconfig.MQSQMANAGER,this.mqsconfig.MQSCHANNELNAME,this.mqsconfig.MQSCONNECTIONNAME);
mqQMgr = new MQQueueManager(this.mqsconfig.MQSQMANAGER,MQC.MQCNO_HANDLE_SHARE_NO_BLOCK,this.mqsconfig.MQSCHANNELNAME,this.mqsconfig.MQSCONNECTIONNAME);
}
catch (MQException mqe)
{
return (mqe.Reason > 0) ? mqe.Reason * -1 : mqe.Reason;
}

if (mqQMgr == null)
return -1;


try
{
mqQueue1 = mqQMgr.AccessQueue(this.mqsconfig.MQSOUTPUTQNAME,
MQC.MQOO_OUTPUT // open queue for output
+ MQC.MQOO_FAIL_IF_QUIESCING ); // but not if MQM stopping
}
catch (MQException mqe)
{
// stop if failed
//MessageBox.Show( "Manager::AccessQueue ended with " + mqe.Message + " MQ ACCESS DENIE Reason Code " + mqe.Reason.ToString());

return (mqe.Reason > 0) ? mqe.Reason * -1 : mqe.Reason;
}


mqMsg = new MQMessage();
mqMsg.WriteString(msg);
mqMsg.Format = MQC.MQFMT_STRING;
mqPutMsgOpts = new MQPutMessageOptions();
mqMsg.Expiry = 600;

try
{
mqQueue1.Put(mqMsg, mqPutMsgOpts );
}
catch (MQException mqe)
{
// report the error
//MessageBox.Show( "MQQueue::Put ended with " + mqe.Message );

return (mqe.Reason > 0) ? mqe.Reason * -1 : mqe.Reason;
//return -2;
}

this.MQSINTERNALKEY = mqMsg.MessageId;

mqQueue1.Close();
return msg.Length;

}


do you know if I'm using the correct way for putting messages??

Thanks

PS: this application is used for multiple clients at the same time and all of them are putting message in the same queue defined in another server.

PSS: in the server where this C# application is running we only have installed the MQ Client.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Jun 18, 2008 9:56 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9471
Location: US: west coast, almost. Otherwise, enroute.

Did you try it? Did it work? If not, what results did you get? What errors, reason codes?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Problems reading messages from MQ
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.