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 IndexMainframe, CICS, TXSeriesstrange mq client behaviour whan connecting to mainframe

Post new topicReply to topic
strange mq client behaviour whan connecting to mainframe View previous topic :: View next topic
Author Message
ochocki
PostPosted: Mon Jan 05, 2009 1:49 pm Post subject: strange mq client behaviour whan connecting to mainframe Reply with quote

Novice

Joined: 05 Jan 2009
Posts: 10

Hi,

I’m trying to send a message to MQ manager from mq client console
application using following code:
public class MQMessageSender
{
private const string connectionType =
MQC.TRANSPORT_MQSERIES_BINDINGS;
private MQQueue queue;
private MQMessage queueMessage;
private Hashtable connectionProperties = new Hashtable();
private MQGetMessageOptions gmo = new MQGetMessageOptions();
private MQPutMessageOptions queuePutMessageOptions = new
MQPutMessageOptions();
private int pOpenOptions = MQC.MQOO_OUTPUT | MQC.MQOO_BROWSE;
private MQQueueManager qMgr;

public MQMessageSender()
{
connectionProperties.Add(MQC.TRANSPORT_PROPERTY,
connectionType);
gmo.Options = MQC.MQOO_OUTPUT |
MQC.MQOO_FAIL_IF_QUIESCING;
gmo.WaitInterval = 100000;
qMgr = new MQQueueManager(„CSQ1”, connectionProperties);
queue = qMgr.AccessQueue(„EREV.QL.TEST”, pOpenOptions);
}

public void PutMessage(string strMessageText)
{
queueMessage = new MQMessage();
queueMessage.WriteString(strMessageText);
queuePutMessageOptions = new MQPutMessageOptions();
queue.Put(queueMessage, queuePutMessageOptions);
}

}


I works fine while connecting to queue manager running on windows, but
when I try to use the same code to connect to qm running on mainframe
server it behaves strange.
Using MQAdmin I can see that message counter on destination queue (on
mainframe) is being incremented, but when I try to browse the queue
the message appears to be empty.

Some additional tests that I performed:

1) q.exe works just fine
2) example form MQ installation (IBM\WebSphere MQ\Tools\dotnet\samples
\cs\nmqsput.cs) works even worse than my code (queue depth is
incremented, but then goes back to previous state)

Anybody can explain this?

Marcin
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Mon Jan 05, 2009 2:03 pm Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Code:
gmo.Options = MQC.MQOO_OUTPUT |
MQC.MQOO_FAIL_IF_QUIESCING;


Get message options? OO_OUTPUT? Are you sure? That will translate to BROWSE_FIRST


Last edited by kevinf2349 on Mon Jan 05, 2009 2:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jan 05, 2009 2:06 pm Post subject: Re: strange mq client behaviour whan connecting to mainframe Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ochocki wrote:
Anybody can explain this?


Mainframe queue managers use syncpoint by default, other platforms do not. Messages are going onto the mainframe queue (causing the count to increase) but are not eligable to be read back (appearing to be blank) and eventually roll back (causing the count to decrease again).

Use an explicit commit (like q.exe does). It won't affect running again non-mainframe queue managers.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
ochocki
PostPosted: Mon Jan 05, 2009 11:54 pm Post subject: Reply with quote

Novice

Joined: 05 Jan 2009
Posts: 10

Thanx Vitor! It works fine after qmgr.Commit()

M.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexMainframe, CICS, TXSeriesstrange mq client behaviour whan connecting to mainframe
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.