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 » Urgent: How to use GetMessageOptions and PutMessageOptions i

Post new topic  Reply to topic
 Urgent: How to use GetMessageOptions and PutMessageOptions i « View previous topic :: View next topic » 
Author Message
wildtiger
PostPosted: Mon May 06, 2002 8:10 am    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Hi,

I'm going to set PutMessageOptions and GetMessageOptions before send / receive message from MQ queue. How can I set them in MQ-JMS application? I cannot find a way in MQ-JMS classes.

By the way, I'm going to send a big file via MQ queue. So I have to send a group of messages. What's the normal way to group messages? The following is what I understood about it:

Sender:

Open file
read the first part of the file, and assign to a TextMessage object
specify the PutMessageOption ( MQPMO_LOGICAL_ORDER )
while ( not end-of-file )
{
send the message ( with MQMF_MSG_IN_GROUP or MQMF_LAST_MSG_IN_GROUP (if it is the last message) )
read the next part of the file, and assign to the TextMessage object
}
close file

Receiver:

Open a file for writing
Set GetMessageOptions to MQGMO_LOGICAL_ORDER
Read the first message of the group from the queue
while ( not MQMF_LAST_MSG_IN_GROUP )
{
write the message to the file
read the next message of the group from the queue
}
close file

The questions are:
1) How can I know which message is the first message of the group? Do I have to browse firstly? Is the first message with the MQMF_MSG_IN_GROUP is the frist message in the group?
2) Do I have to remember the GroupID when I get the first message?

Thanks in advance



Back to top
View user's profile Send private message
sanjays30
PostPosted: Mon May 06, 2002 2:18 pm    Post subject: Reply with quote

Novice

Joined: 05 May 2002
Posts: 18
Location: USA

JMS API is quite different than MQI, You can solve this in number of more Object Oriented and elegent ways.
You can define Custom header, and use message selector to read in a sequence, use a ByteMessage type of JMS Message.

For Browsing There is separate JMS class javax.jms.QueueBrowser, It does not work in the way MQI work by just specifing Option(and confusing the programmer)
Back to top
View user's profile Send private message
wildtiger
PostPosted: Mon May 06, 2002 4:37 pm    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

Thank you very much for your information.

Do u mean that I cannot use the grouping feature of MQ via JMS way? So I have to develop other ways dealing with the grouping messages?
Back to top
View user's profile Send private message
sanjays30
PostPosted: Tue May 14, 2002 10:47 am    Post subject: Reply with quote

Novice

Joined: 05 May 2002
Posts: 18
Location: USA

I believe so, The Custom Property and Message Selectors are really easy and COOL! There are many MQ features not exposed through JMS, but there are a lot others which are not there in MQI.
Back to top
View user's profile Send private message
amurugan
PostPosted: Tue May 14, 2002 9:56 pm    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2001
Posts: 75
Location: india

hi wild tiger ,
You can use the grouping of messages in mqseries jms . chec out the JMSXGroupID and JMSXGroupSeq field in the message header . They are used for sending the messages in groups. I am sure you can achieve group thru this. let me know whether does it help u


cheers,
Murugan
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
sanjays30
PostPosted: Wed May 15, 2002 11:44 am    Post subject: Reply with quote

Novice

Joined: 05 May 2002
Posts: 18
Location: USA

where did you find these properties, i did not find them in javax.jms.Message or any Message subclass
Back to top
View user's profile Send private message
amurugan
PostPosted: Wed May 15, 2002 6:02 pm    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2001
Posts: 75
Location: india

hi sanjay ,
you can find them in the mqseries for java doc in mapping between jms fields and mqmd fields. All the fields which you can manipulate in mq base java are available as eitherr vendor specific which are refixed by JMS_IBM or as part of the standard header like the groups id and grup seq . let me know whether can you find them or i will send u the doc

cheers,
Murugan
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
amurugan
PostPosted: Wed May 15, 2002 6:02 pm    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2001
Posts: 75
Location: india

hi sanjay ,
you can find them in the mqseries for java doc in mapping between jms fields and mqmd fields. All the fields which you can manipulate in mq base java are available as eitherr vendor specific which are refixed by JMS_IBM or as part of the standard header like the groups id and grup seq . let me know whether can you find them or i will send u the doc

cheers,
Murugan
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
techno
PostPosted: Fri Apr 02, 2004 9:08 am    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

This is a general question...

I have seen mapping of different fields in the header. I do not see any way to manipulate most of the fields through API? Is there any other way to do that? For example, If I want the COA and COD in JMS, though I could find the mapping, I could not find the way to say ' Report Required'.

Thanks for any help.
Back to top
View user's profile Send private message
techno
PostPosted: Fri Apr 02, 2004 1:49 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Is this the way I can do?

msg.setIntProperty("JMS_IBM_Report_COA", MQC.MQRO_COA);
msg.setIntProperty("JMS_IBM_Report_COD", MQC.MQRO_COD);

But MQC.MQRO_COA and MQC.MQRO_COD are of Base MQ!


I did above. Request-Sent_side received COA, but COD. Any Help pls?


Also, my application listener (onMessage())has trouble receiving that message... May be because that is not a regular message. It is not even able to receive it. Any one of you had this problem before?
(Report Message comes from mainframe to hp-ux)

Thanks


Last edited by techno on Fri Apr 02, 2004 2:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
techno
PostPosted: Fri Apr 02, 2004 2:18 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Here is the Report Message

MQGET of message number 2
****Message descriptor****

StrucId : 'MD ' Version : 2
Report : 0 MsgType : 4
Expiry : -1 Feedback : 259
Encoding : 273 CodedCharSetId : 819
Format : 'MQHRF2 '
Priority : 4 Persistence : 1
MsgId : X'C3E2D840D4D8C4F24040404040404040BB0265826431F802'
CorrelId : X'414D512044484F434C4D322020202020406DDBA220000306'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'QMGR '
** Identity Context
UserIdentifier : 'oracle '
AccountingToken :
X'0331303100000000000000000000000000000000000000000000000000000006'
ApplIdentityData : ' '
** Origin Context
PutApplType : '7'
PutApplName : 'QMGR '
PutDate : '20040402' PutTime : '14043796'
ApplOriginData : ' '

GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'

**** Message ****

length - 100 bytes

00000000: 5246 4820 0000 0002 0000 0120 0000 0111 'RFH ....... ....'
00000010: 0000 04B8 2020 2020 2020 2020 0000 0000 '.... ....'
00000020: 0000 04B8 0000 0020 3C6D 6364 3E3C 4D73 '....... <mcd><Ms'
00000030: 643E 6A6D 735F 6F62 6A65 6374 3C2F 4D73 'd>jms_object</Ms'
00000040: 643E 3C2F 6D63 643E 0000 007C 3C6A 6D73 'd></mcd>...|<jms'
00000050: 3E3C 4473 743E 7175 6575 653A 2F2F 2F43 '><Dst>queue:///C'
00000060: 4C4D 2E45 'LM.E '

And this is the error:
2004.04.02 14:12:00 MQJMS1016E an internal error has occurred. Please contact yo
ur system administrator. Detail: java.lang.NullPointerException
Back to top
View user's profile Send private message
bower5932
PostPosted: Sat Apr 03, 2004 6:00 pm    Post subject: Reply with quote

Jedi Knight

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

I thought that there was a NullPointerException in CSD4 that was fixed in CSD5. What version of MQ are you running? You can get it with mqver.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
techno
PostPosted: Mon Apr 05, 2004 12:29 pm    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

$ mqver
Name: WebSphere MQ
Version: 530.5 CSD05
CMVC level: p530-05-L030926
BuildType: IKAP - (Production)
$

It is CSD05!

Code:

Code:
msg.setJMSReplyTo(qQueueSender);
msg.setIntProperty("JMS_IBM_Report_COA", MQC.MQRO_COA_WITH_DATA);
msg.setIntProperty("JMS_IBM_Report_COD", MQC.MQRO_COD);
msg.setIntProperty("JMS_IBM_MsgType", MQMT_REQUEST);

Thanks
Back to top
View user's profile Send private message
techno
PostPosted: Thu Apr 08, 2004 7:54 am    Post subject: Reply with quote

Chevalier

Joined: 22 Jan 2003
Posts: 429

Also: I am getting COA, but COD. Could you throw some hints ?

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Urgent: How to use GetMessageOptions and PutMessageOptions i
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.