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 » Accessing MQMD and MQRFH headers in java

Post new topic  Reply to topic
 Accessing MQMD and MQRFH headers in java « View previous topic :: View next topic » 
Author Message
MKB
PostPosted: Wed Oct 17, 2012 2:08 am    Post subject: Accessing MQMD and MQRFH headers in java Reply with quote

Newbie

Joined: 17 Oct 2012
Posts: 4
Location: India

Hi,

I'm able to read a message from a queue and write message body into a file using MQMessage class.Is there any way to write message body with MQMD and MQRFH headers into a file using java?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 17, 2012 3:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/topic/com.ibm.mq.csqzaw.doc/ja35130_.htm
Back to top
View user's profile Send private message
MKB
PostPosted: Wed Oct 17, 2012 8:18 am    Post subject: Reply with quote

Newbie

Joined: 17 Oct 2012
Posts: 4
Location: India

Thanks for the link jeff.

I'm able to access headers like MQRFH with MQHeaderIterator class. Is there any way to access MQMD in similar way?

I have one more question
Is it possible to read MQMD and MQRFH headers from a file and set them while putting a message into queue?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 17, 2012 8:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There is no method that is supplied by the MQ Java libraries for serializing headers to or from files, or for serializing any MQ information to and from a file.

That has nothing to do with what is possible or not. What is required is that you think.

If you spend even two minutes looking at the java doc for the MQMessage class it should be apparent how you access the MQMD.

If you are writing Java code and you do not make any effort to read javadoc first to assist in problem solving, then you are not a Java programmer.
Back to top
View user's profile Send private message
MKB
PostPosted: Wed Oct 17, 2012 9:10 am    Post subject: Reply with quote

Newbie

Joined: 17 Oct 2012
Posts: 4
Location: India

I know how to access elements of MQMD one by one by using MQMessage.
But I'm just searching for a method which reduce my number of lines of code..
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 17, 2012 11:55 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Oh, well, if you just want to simplify your code, then just change all the lines that read the mqmd fields individually into code that calls a method
Code:
public byte[] flattenMQMD(MqMessage)


And then write the method.
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 » Accessing MQMD and MQRFH headers in java
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.