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 » Problem is reading the response as ASCII

Post new topic  Reply to topic
 Problem is reading the response as ASCII « View previous topic :: View next topic » 
Author Message
pmehta
PostPosted: Thu Apr 01, 2004 1:54 am    Post subject: Problem is reading the response as ASCII Reply with quote

Novice

Joined: 29 Jul 2003
Posts: 13

I am using JMS to put and get the messages. My problem is that the response is coming from the z/os system. The response can be either in binary or in ASCII or in both Binayr as well as ASCII.
I want to always receive the message in ASCII. But I have no idea of how we can handle this with MQ and JMS
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Apr 01, 2004 6:23 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

There are 5 types of messages that can be sent via JMS. You can find information on them in the Using Java manual. If I understand your question, look at using a BytesMessage rather than a TextMessage.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Thu Apr 01, 2004 6:33 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you sure you don't have that backwards?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Apr 01, 2004 6:35 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I thought he wanted to mix binary and ascii data in the same message. I figured this would be Bytes rather than Text?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Thu Apr 01, 2004 7:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

bower5932 wrote:
I thought he wanted to mix binary and ascii data in the same message. I figured this would be Bytes rather than Text?


If he "want to always receive the message in ASCII"?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Apr 01, 2004 7:02 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Quote:
or in both Binayr as well as ASCII

I took this to mean that the message was mixed.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Thu Apr 01, 2004 7:53 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well, yes, it does sound like the response will be mixed.

But it also sounds like he wants the mixed stuff converted to ASCII.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
pmehta
PostPosted: Fri Apr 02, 2004 1:24 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2003
Posts: 13

yes the response which is coming is having a mixed format and i want that mixed stuff to be converted into ASCII.

How can i use the BytesMessage instead of TextMessage?
For TextMessage MQMD format is set as MQSTR. Which MQMD format should be used to get the BytesMessage.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 02, 2004 5:29 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you do want everything to be ASCII string data, then you do need to use a TextMessage, and the MQMD Format should be MQFMT_STRING.

But you really need to be aware of what happens when you treat binary data as ASCII data. It's really probably not what you want to do. One thing that could happen is if your binary data contains a binary 0, then your string data may get truncated.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Fri Apr 02, 2004 6:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you are going to mix the data in the message (ie, binary and ascii), then MQ won't be able to know anything about it. You'll have to define your own message format (don't start it with MQ, they're reserved) and write a conversion exit to convert the data.

As Jeff said, you need to watch what you are doing. Depending on the data, you might be better off flowing it all as text. You can then treat the message as a string and have MQ convert it. You'd have to convert the strings back to binary yourself.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem is reading the response as ASCII
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.