|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQCMIT MQBACK - Conn Handler Error. |
« View previous topic :: View next topic » |
Author |
Message
|
nr_shan |
Posted: Fri Jun 06, 2008 6:19 pm Post subject: MQCMIT MQBACK - Conn Handler Error. |
|
|
Newbie
Joined: 29 Jan 2008 Posts: 6
|
Hi,
I wrote a ESQL/C program to read the Logical group of Messages (UOW) from my Local Queue.
Please find my sample ESQL/C code.
During Compilation and Execution i didnt get error in MQBEGIN(); function.
During runtime if there is any error, am just executing MQBACK(); function to put back whatever messages read by my program, at this time am getting Connection Handler Error.
When i browse my Local-Queue i can see only less number of messages in UOW, i.e., whatever messages read by my program were not written back to the local Queue.
kindly help me to resolve this issue.
=======================
MQCONN();
Options= MQOO_INPUT_SHARED + MQOO_FAIL_IF_QUIESCING;
MQOPEN();
gGetCompCode = MQCC_OK;
While(gGetCompCode != MQCC_FAILED)
{
lBeginOptions.Version = MQBO_CURRENT_VERSION;
MQBEGIN();
gGetMsgOptn.Options = MQGMO_WAIT + MQGMO_CONVERT +
MQGMO_ACCEPT_TRUNCATED_MSG;
memcpy(gMsgDesc.MsgId, MQMI_NONE, sizeof(gMsgDesc.MsgId));
memcpy(gMsgDesc.CorrelId, MQCI_NONE, sizeof(gMsgDesc.CorrelId));
memcpy(gMsgDesc.GroupId, MQCI_NONE, sizeof(gMsgDesc.GroupId));
memcpy(gMsgDesc.Format,MQFMT_STRING, (size_t)MQ_FORMAT_LENGTH);
MQGET();
if any error then
MQBACK();
exit program;
endif
while(gCompCode != MQCC_FAILED)
{
gMsgDesc.Version = MQMD_VERSION_2;
gGetMsgOptn.Version = MQGMO_VERSION_2;
memcpy(gMsgDesc.Format,MQFMT_STRING, (size_t)MQ_FORMAT_LENGTH);
gGetMsgOptn.Options = MQGMO_ACCEPT_TRUNCATED_MSG + MQGMO_WAIT + MQGMO_CONVERT ;
gGetMsgOptn.MatchOptions = MQMO_MATCH_GROUP_ID;
gGetMsgOptn.WaitInterval = 1000;
MQGET();
if any error then
MQBACK();
exit program;
endif
}
MQCMIT();
}
MQCLOSE();
Regards,
Ravi |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jun 07, 2008 7:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Why reinvent the wheel? Use an MQInput node and set the right properties on the input node:
Logical message, full message only
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
nr_shan |
Posted: Sun Jun 08, 2008 8:51 pm Post subject: |
|
|
Newbie
Joined: 29 Jan 2008 Posts: 6
|
MQInput? Is there any function name called MQInput? or you are referring MQGET() only?. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 11, 2008 4:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nr_shan wrote: |
MQInput? Is there any function name called MQInput? or you are referring MQGET() only?. |
I think the question being posed is why are you writing a function to do this when the MQInput node already does this out of the box. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 11, 2008 5:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think that nr_shan is using a different meaning of "ESQL/C", and therefore not actually using MessageBroker.
I also think nr_shan should review some of the other MQ samples, and review the APG on Syncpoint and the use of MQCMIT/MQBACK... as there doesn't appear to be an unit of work in the code posted. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 11, 2008 5:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
I think that nr_shan is using a different meaning of "ESQL/C", and therefore not actually using MessageBroker.
|
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|