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 » General Discussion » MQOP_START donot work but MQOP_START_WAIT do

Post new topic  Reply to topic
 MQOP_START donot work but MQOP_START_WAIT do « View previous topic :: View next topic » 
Author Message
yasaboy
PostPosted: Sun Jul 27, 2014 9:54 pm    Post subject: MQOP_START donot work but MQOP_START_WAIT do Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

Hi,

Code:
MQCTL(Hcon,MQOP_START_WAIT,&ctlo,                                   
&CompCode,&Reason);



What is the differnce between MQOP_START_WAIT and MQOP_START in MQCTL.

When we try to implement a MQCB for a Queue, it only works when we use MQOP_START_WAIT. Without wait it simply exits the progrm without getting the messages from the callback queue. But shouldn't it be working for MQOP_START as given in the examples? please help
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Mon Jul 28, 2014 1:01 am    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

The difference is clearly described in the manual. MQOP_START_WAIT effectively donates the current thread to the async. consumer. So, messages are delivered to the callback functions on the same thread as issues the MQCTL call. So, essentially the MQCTL call blocks until you suspend or stop consumption.

The MQOP_START call returns immediately and callback functions are calls on different threads that are managed by MQ. Since the MQCTL call returns immediately you need to do something with that thread. Usually you are in a message loop, or waiting for some user input, or perhaps even waiting on an MQ message in an MQGET. What you don't want to do of course is issue the MQCTL call and then let that main thread continue and end the application.

Hope this helps,

Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
yasaboy
PostPosted: Mon Jul 28, 2014 8:57 pm    Post subject: Reply with quote

Voyager

Joined: 23 Jun 2014
Posts: 90

@PaulClarke Thanks fop the Mate
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 » General Discussion » MQOP_START donot work but MQOP_START_WAIT do
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.