|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQOP_START donot work but MQOP_START_WAIT do |
« View previous topic :: View next topic » |
Author |
Message
|
yasaboy |
Posted: Sun Jul 27, 2014 9:54 pm Post subject: MQOP_START donot work but MQOP_START_WAIT do |
|
|
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 |
|
 |
PaulClarke |
Posted: Mon Jul 28, 2014 1:01 am Post subject: |
|
|
 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 |
|
 |
yasaboy |
Posted: Mon Jul 28, 2014 8:57 pm Post subject: |
|
|
Voyager
Joined: 23 Jun 2014 Posts: 90
|
@PaulClarke Thanks fop the Mate  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|