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 » IBM MQ Java / JMS » Setting Message ID

Post new topic  Reply to topic
 Setting Message ID « View previous topic :: View next topic » 
Author Message
nik_iway
PostPosted: Sat Nov 26, 2005 4:09 am    Post subject: Setting Message ID Reply with quote

Centurion

Joined: 21 Jul 2005
Posts: 115

HI Everybody,

I am using JAVA API to put a message in the Request Queue and Get Back the Message from the same Request Queue.

In my Request Program Iam Setting My Message ID as shown Below:

String requestmessageId = "REQUEST";
requestmessage.messageId = requestmessageId.getBytes();
System.out.println("Message ID Request Message is : " + requestmessageId);

In my Reply Program i am writing the Following logic so as to get a message with Message ID as "REQUEST"

String replymessageId = "REQUEST";
//replymessage.messageId = replymessageId.getBytes();
System.out.println("Reply Message ID: " + replymessageId);
if(replymessage.messageId.equals(replymessageId))
{
System.out.println("Reply Message ID: " + replymessageId);
queue.get(replymessage, gmo);
// Printing the Message into the File
String reply = replymessage.readString(replymessage.getMessageLength());
FileOutputStream out;
// declare a file output object
PrintStream p;
// declare a print stream object
try
{
// Create a new file output stream // connected to "myfile.txt"
out = new FileOutputStream("C:\\reply.txt");
// Connect print stream to the output stream
p = new PrintStream( out );
p.println (reply);
p.close();
}
catch (Exception e)
{
System.err.println ("Error writing to file");
}
}
else
{
System.out.println("REPLY MESSAGE NOT AVIALABLE");
}

When i running my MQreply program it is saying No Message Found

Please do giude me if my code is wrong
Waiting for reply
Regards
Naresh
Back to top
View user's profile Send private message
vennela
PostPosted: Sat Nov 26, 2005 5:21 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

What are your PUT message options and get message options
Back to top
View user's profile Send private message Send e-mail Visit poster's website
wschutz
PostPosted: Sat Nov 26, 2005 5:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

And please post the current version of your code, I don't see how the test "if(replymessage.messageId.equals(replymessageId))" can evaluate to TRUE:

Code:
String replymessageId = "REQUEST";
//replymessage.messageId = replymessageId.getBytes();
System.out.println("Reply Message ID: " + replymessageId);
if(replymessage.messageId.equals(replymessageId))
{

_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Setting Message ID
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.