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 » Queue depth events using WebSphere MQ C++ classes

Post new topic  Reply to topic
 Queue depth events using WebSphere MQ C++ classes « View previous topic :: View next topic » 
Author Message
preichar
PostPosted: Tue Jun 05, 2007 6:52 am    Post subject: Queue depth events using WebSphere MQ C++ classes Reply with quote

Newbie

Joined: 05 Jun 2007
Posts: 2

hi,

i would be glad if you could give me a hint or two - thank you

0. setup
--------
* MQSeries 5.3 solaris
* WebSphere MQ C++ classes
* 1 sender thread
* 1 monitor thread

1. enable performance events
----------------------------
#!/bin/bash
# Example 1 (adjusted) from 'Event Monitoring'

runmqsc CHP_QUEUE_MANAGER << EOF
ALTER QMGR PERFMEV(ENABLED)
ALTER QLOCAL(CHP_BBP_QUEUE) +
MAXDEPTH(10) +
QDPMAXEV(DISABLED) +
QDEPTHHI(80) +
QDPHIEV(ENABLED) +
QDEPTHLO(20) +
QDPLOEV(DISABLED)
EOF

2. monitor thread: open option
------------------------------
MQOO_INPUT_AS_Q_DEF + MQOO_FAIL_IF_QUIESCING

3. monitor thread: get option
-----------------------------
MQGMO_WAIT | MQGMO_FAIL_IF_QUIESCING

4. Contents of ImqMessage after receiving event from sender thread
------------------------------------------------------------------

the receiving queue hits the depth high limit which triggers the 'queue depth
high' event. m_msg is read out from the SYSTEM.ADMIN.PERFM.EVENT queue and has the following contents

ImqMessage m_msg;

(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) print -r m_msg
m_msg = {
ImqMsg::ImqCac::ImqErr::olCompletionCode = 0
ImqMsg::ImqCac::ImqErr::olReasonCode = 0
ImqMsg::ImqCac::opszBuffer = 0x7e940 ""
ImqMsg::ImqCac::ouiDataOffset = 0
ImqMsg::ImqCac::ouiBufferLength = 2048U
ImqMsg::ImqCac::ouiMessageLength = 236U
ImqMsg::ImqCac::obAutomaticBuffer = '\001'
ImqMsg::ImqCac::ocPadding1 = ""
/* already printed virtual baseclass ImqMsg::ImqErr, skipping */
ImqMsg::ImqMtr::opvoidAccountingToken = 0x74434
ImqMsg::ImqMtr::opvoidCorrelationId = 0x743ac
ImqMsg::ImqMtr::oplFeedback = 0x74378
ImqMsg::ImqMtr::opvoidGroupId = 0x744a8
ImqMsg::ImqMtr::opvoidMessageId = 0x74394
ImqMsg::omqmd = {
tagMQMD2::StrucId = "MD "
tagMQMD2::Version = 2
tagMQMD2::Report = 0
tagMQMD2::MsgType = 8
tagMQMD2::Expiry = -1
tagMQMD2::Feedback = 0
tagMQMD2::Encoding = 273
tagMQMD2::CodedCharSetId = 819
tagMQMD2::Format = "MQEVENT "
tagMQMD2::Priority = 0
tagMQMD2::Persistence = 0
tagMQMD2::MsgId = "AMQ CHP_QUEUE_MAF_⢠"
tagMQMD2::CorrelId = ""
tagMQMD2::BackoutCount = 0
tagMQMD2::ReplyToQ = " "
tagMQMD2::ReplyToQMgr = "CHP_QUEUE_MANAGER "
tagMQMD2::UserIdentifier = " "
tagMQMD2::AccountingToken = ""
tagMQMD2::ApplIdentityData = " "
tagMQMD2::PutApplType = 7
tagMQMD2::PutApplName = "CHP_QUEUE_MANAGER "
tagMQMD2::PutDate = "20070605"
tagMQMD2::PutTime = "12515515"
tagMQMD2::ApplOriginData = " "
tagMQMD2::GroupId = ""
tagMQMD2::MsgSeqNumber = 1
tagMQMD2::Offset = 0
tagMQMD2::MsgFlags = 0
tagMQMD2::OriginalLength = -1
}
ImqMsg::ouiTotalMessageLength = 236U
}
(/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx)

5. Questions
------------

* message Data containing event header and event data is empty (opszBuffer)
1. why? are there any parameters missing (open or get options)?
2. how can i access event header and event data with WebSphere MQ C++ classes?
3. is there any sample code available using WebSphere MQ C++ classes?
Back to top
View user's profile Send private message
tleichen
PostPosted: Wed Jun 13, 2007 10:50 am    Post subject: Re: Queue depth events using WebSphere MQ C++ classes Reply with quote

Yatiri

Joined: 11 Apr 2005
Posts: 663
Location: Center of the USA

preichar wrote:
...
5. Questions
------------

* message Data containing event header and event data is empty (opszBuffer)
1. why? are there any parameters missing (open or get options)?
2. how can i access event header and event data with WebSphere MQ C++ classes?
3. is there any sample code available using WebSphere MQ C++ classes?
1. Since you did not show your get call, I cannot speculate if you have left out something. What buffer size did you supply?
2. Event header and event data? Do you mean the message data? Hmmm..
3. Yes. It is supplied with the product.
_________________
IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer
Back to top
View user's profile Send private message
preichar
PostPosted: Thu Jun 14, 2007 1:11 am    Post subject: Re: Queue depth events using WebSphere MQ C++ classes Reply with quote

Newbie

Joined: 05 Jun 2007
Posts: 2

tleichen wrote:
1. Since you did not show your get call, I cannot speculate if you have left out something. What buffer size did you supply?
2. Event header and event data? Do you mean the message data? Hmmm..
3. Yes. It is supplied with the product.


1. I use the following code snippet:

Code:
void A::setup()
{
  ImqQueue* pQueue = new ImqQueue();
  pQueue->setConnectionReference(/* some queue manager object */);

  pQueue->setName("SYSTEM.ADMIN.PERFM.EVENT");
  pQueue->setOpenOptions(MQOO_INPUT_AS_Q_DEF+MQOO_FAIL_IF_QUIESCING);
  pQueue->open();

  // store pQueue in a queue list
}

//------------------------------------------------

void A::read()  // called periodically
{
  ImqMessage m_msg;
  ImqGetMessageOptions gmo;

  long getOption = MQGMO_WAIT | MQGMO_FAIL_IF_QUIESCING;

  gmo.setOptions(getOption);
  gmo.setWaitInterval(100);  // 100ms limit for waiting

  m_msg.clearMessage();
  m_msg.useEmptyBuffer(0, 0);
  m_msg.setMessageId();
  m_msg.setCorrelationId();

  ImqQueue* pQueue = // retrieve from a queue list

  if(pQueue->get(m_msg, gmo))
  {
    // m_msg seems to be empty...see my first posting
  }
}


2. In the documentation 'Event Monitoring' , chapter 4 (Event message format) there is this table displaying the structure of a event message:
MQMD descriptor followed by the message data, whereas the message data is divided into event header (MQCFH) and event data

3. The examples I found use the C API - I would prefer to use the ImqXXX API. Could you please point out the location of the examples? Thank you
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 » Queue depth events using WebSphere MQ C++ classes
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.