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 » WebSphere Message Broker (ACE) Support » Creating MQRFH2 Headers(usr folder) using jms

Post new topic  Reply to topic
 Creating MQRFH2 Headers(usr folder) using jms « View previous topic :: View next topic » 
Author Message
ppraveen33
PostPosted: Mon Nov 18, 2013 9:16 am    Post subject: Creating MQRFH2 Headers(usr folder) using jms Reply with quote

Apprentice

Joined: 26 Jun 2013
Posts: 36

HI,
My scenario is keepina File data to a Queue. I am trying to create MQRFH2 Headers using JMS, But I am unable to create usr folder in the headers.In usr my structure should be like
MQRFH2/usr/srcSystem/Country
MQRFH2/usr/srcSystem/serviceId

My CODE is as follows:
String l_dbPropFile = BrokerConstants.getDbPropertyFilePath().trim();
Properties properties = new Properties();
properties.load(new FileInputStream(l_dbPropFile));
FileInputStream inputStream = new FileInputStream(l_oldFile);
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb = new StringBuilder();
String line,line1;
MbElement mbElement =
String QMGR=properties.getProperty("QueueManager");
MQQueueManager Qmgr = new MQQueueManager(QMGR);
int openOptions = MQC.MQOO_OUTPUT ;
MQQueue Queue = Qmgr.accessQueue(queuename,openOptions);
MQMessage mqMessage = new MQMessage();
MQMessage sendmsg1 = new MQMessage();

MQPutMessageOptions pmo = new MQPutMessageOptions();
if(mqfrh2!=null)
{
mqMessage.format = MQC.MQFMT_RF_HEADER_2; // Msg Format
mqMessage.writeString(MQC.MQRFH_STRUC_ID); // StrucId
mqMessage.writeInt4(MQC.MQRFH_VERSION_2); // Version
mqMessage.writeInt4(MQC.MQRFH_STRUC_LENGTH_FIXED_2 ); // StrucLength
mqMessage.writeInt4(MQC.MQENC_NATIVE); // Encoding
mqMessage.writeInt4(MQC.MQCCSI_DEFAULT); // CodedCharacterSetId
mqMessage.writeString(MQC.MQFMT_NONE); // Format (content)
mqMessage.writeInt4(MQC.MQRFH_NO_FLAGS); // Flags
mqMessage.writeInt4(1208); // NameValueCCSID = UTF-8
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Nov 18, 2013 9:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should do none of this using custom Java code from inside broker.

Broker has a node to read the contents of the file.

Broker has a node to write a message to a queue.

Broker has a node to write a JMS message.

You should use all of those functions that are already written.

do not write java code to do this from within Broker/IIB.
Back to top
View user's profile Send private message
ppraveen33
PostPosted: Mon Nov 18, 2013 9:21 am    Post subject: Reply with quote

Apprentice

Joined: 26 Jun 2013
Posts: 36

HI,

I am constructing this message in 6.1 So can u elaborate your answer or can you provide me the link so that I will look into it.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Nov 18, 2013 9:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/aa40000_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac55150_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac24850_.htm

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac24830_.htm


Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 18, 2013 9:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

ppraveen33 wrote:
So can u elaborate your answer


I think this is pretty clear:

mqjeff wrote:

Broker has a node to read the contents of the file.

Broker has a node to write a message to a queue.

Broker has a node to write a JMS message.

You should use all of those functions that are already written.

do not write java code to do this from within Broker/IIB.


You're treating WMB like it's WAS and it hosts Java code. This is conceptually wrong. It's also a one-way ticket to misery to attempt to access any WMQ object (especially in v6.1) outside of the supplied node. This will end badly.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » WebSphere Message Broker (ACE) Support » Creating MQRFH2 Headers(usr folder) using jms
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.