Posted: Sun Jul 25, 2004 11:20 pm Post subject: Unable to transfer message from on Queue to Other
Newbie
Joined: 25 Jul 2004 Posts: 1 Location: Bangalore
Hi All,
I Completely new to MQ Series , but have to jump directly into Coding. I have a written downloaded some code from the net. But a part of it does not work. This is what I am trying to do and the status for the same.
1. Connect to MQ --- Working
2. Put Message on a First Queue -- Working (Request Queue)
3. Transfer Message from First Queue to Second Queue -- NOT WORKING
4. GET Message from Second Queue and dislay -- Partially working
In case of 4 , I am trying to copy the message from First Q to the Second one using FirstQ.ReplyQueue = SecondQ. But it does not work
requestQueue.Put(requestMessage); // put request message
requestMessage.CorrelationId = requestMessage.MessageId; // response correlation id has to match
responseMessage.MessageId=requestMessage.MessageId;
//requestMessage.Report = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;
// the request message id //commented
//responsemessage.
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_WAIT; // tell get to wait
gmo.WaitInterval = 15 * 1000; // tell get to wait up to 60 seconds
//gmo.MatchOptions = MQC.MQMO_MATCH_CORREL_ID;
requestQueue.Close();
try
{
responseQueue.Get(responseMessage, gmo );
response message
line = responseMessage.ReadString(responseMessage.MessageLength);
return line;
}
catch (MQException mqe)
{
String mText = mqrcText.getMQRCText(mqe.Reason);
//Message Queue is Empty
if ( mText.Equals("MQRC_NO_MSG_AVAILABLE"))
{
// special report for normal end
message="No more messages on Reply queue";
//System.Console.ReadLine();
return message;
}
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
Is this question specific to WMQe (everyplace)? If not, I'd suggest that you try posting it in the API Support section. You'll have a better chance of getting an answer.
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