Click here to Skip to main content
15,921,548 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
using IBM.WMQ;

MQQueue queue;
MQMessage mq_msg;
MQGetMessageOptions gmoptions;
MQQueueManager oMQQMGR;

mq_msg = new MQMessage();
queue.Get(mq_msg, gmoptions);
string message_text = mq_msg.ReadString(mq_msg.DataLength);

oMQQMGR.Commit();

Once read, is there any option to RollBack/Un Commit ?

What I have tried:

I am not performing the commit as the Biz logic fails, why the item is not coming back to queue? Once read, is there any option to RollBack/Un Commit. Options are given for rollback and Non commit, but not really happening.

Please Comment
Posted
Updated 26-Jun-18 6:25am

1 solution

In general, you cannot "uncommit" the type of "read" you describe; for any type of "queue".

What you want is the equivalent of a "peek" function which "most" queues support.

rabbitmq - Message peek in IBM MQ - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900