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 » RFH appearing in 'Message Data'

Post new topic  Reply to topic
 RFH appearing in 'Message Data' « View previous topic :: View next topic » 
Author Message
emqueuer
PostPosted: Tue Dec 23, 2008 4:14 am    Post subject: RFH appearing in 'Message Data' Reply with quote

Novice

Joined: 21 Jun 2007
Posts: 24

Hello,
I am developing a standalone Java application that puts a message onto a queue. I am able to put the message on the queue locally (i.e. within IBM Websphere MQ) and read the message. However when I send a message (TextMessage) from my standalone Java application and view it in Websphere MQ it comes out as 'RFH'.

From looking on the internet I gather that the message will be either MQHRF2 or MQSTR and I assume I should be using the latter. Can anyone help please?

Thank you.

Here is my putMsg method:

static void putMsg( Destination myDest )
throws JMSException, Exception
{
String outString = null;

// Use generic MessageProducer instead of Queue/Topic Producer
MessageProducer myProducer = session.createProducer(myDest);

// Get user input and create messages. Loop until user sends CR.
System.out.println( "\nSending messages to" + myDest.toString() +
"\nEnter a blank line to quit.\n");
do {
byte[] input = new byte[80];
System.out.print("Enter a message to send: ");
System.in.read(input);
outString = (new String(input, 0, input.length)).trim();

if (outString.length() > 0) {
TextMessage outMessage = session.createTextMessage();
outMessage.setText(outString);
myProducer.send(outMessage);
System.out.print("***outMessage: "+outMessage);
session.commit();
}
} while (outString.length() > 0);

myProducer.close();
}
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Dec 23, 2008 4:27 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Make output messages non-JMS specific by using q.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ) ;
Back to top
View user's profile Send private message
emqueuer
PostPosted: Tue Dec 23, 2008 5:43 am    Post subject: Reply with quote

Novice

Joined: 21 Jun 2007
Posts: 24

zpat wrote:
Make output messages non-JMS specific by using q.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ) ;


Thank you for your reply. I have seen this before in the folowing context:

-----------------------------------------------------------------------------------
Queue queue = session.createQueue("default");

// Force MQSTR format
((MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);

QueueSender messageProducer = session.createSender(queue);
TextMessage textMessage = session.createTextMessage("Hello MQSTR world via MQQueue#setTargetClient(int) " + new Date());

messageProducer.send(textMessage);
-----------------------------------------------------------------------------------

..but I am not creating a Queue object as such. How can I get around this?

Thank you.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 23, 2008 8:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

emqueuer wrote:
zpat wrote:
Make output messages non-JMS specific by using q.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ) ;


Thank you for your reply. I have seen this before in the folowing context:

-----------------------------------------------------------------------------------
Queue queue = session.createQueue("default");

// Force MQSTR format
((MQQueue) queue).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);

QueueSender messageProducer = session.createSender(queue);
TextMessage textMessage = session.createTextMessage("Hello MQSTR world via MQQueue#setTargetClient(int) " + new Date());

messageProducer.send(textMessage);
-----------------------------------------------------------------------------------

..but I am not creating a Queue object as such. How can I get around this?

Thank you.

You have to send the message to a Destination. What type of destination are you creating? You are talking about putting the message onto a queue right?

By the way you can skip the MQ cast and target client set if you use:
Code:
Queue queue = session.createQueue("queue:///default?targetClient=1");


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » RFH appearing in 'Message Data'
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.