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 » General IBM MQ Support » MQPUT question

Post new topic  Reply to topic
 MQPUT question « View previous topic :: View next topic » 
Author Message
ucbus1
PostPosted: Tue Apr 29, 2003 6:43 am    Post subject: MQPUT question Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

I am using Java to put a message in a queue.
I am setting MqEnvironment variables to populate the needed fields.
for example
MQEnvironment.hostname
MQEnvironment.channel
MQEnvironment.port
MQEnvironment.userID

Th is is working fine. I would like to customize the application name . Right now it is defaulting to "MQSeriesClient for java". Is thee any way I can customize and change it to say "xyz". Please let me know
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Apr 29, 2003 1:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

You can use the MQMessage's fields to achieve what you are trying to. There are fields like putApplicationName or applicationIdData that you can use to set to whatever value you want to. From your post it seems that you want to set putApplicationName. But in the open options (while you open the queue) do not forget to include MQC.MQOO_SET_ALL_CONTEXT. and while doing the put you PutMessageOptions should have MQC.MQPMO_SET_ALL_CONTEXT.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ucbus1
PostPosted: Wed Apr 30, 2003 6:06 am    Post subject: Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

Thanks venny.
Thanks for showing the direction. I have the following questions

In "Mq series using java". I find under MQMessage options applicationIdData and putApplicationName are having default values " ". then why I am getting "MQSeriesClient for java" . Ideally it should be the default " ". right?

Quote:
But in the open options (while you open the queue) do not forget to include MQC.MQOO_SET_ALL_CONTEXT. and while doing the put you PutMessageOptions should have MQC.MQPMO_SET_ALL_CONTEXT.


Could you explain significance of the above option?
Thanks
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Apr 30, 2003 8:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Yes, the doc is right.

If your code looks something like this:
Code:
DemoQueue.put(inMessage);
then the putApplicationName will have the value "MQSeriesClient for java".

But if your code looks something like this
Code:

MQPutMessageOptions pmo = new MQPutMessageOptions();
DemoQueue.put(inMessage, pmo);

//MQMessage's values are defaults.
then you will have spaces in the putApplicationName filed

MQC.MQOO_SET_ALL_CONTEXT
If you don't use this option, you will not be able to set some fileds like the above ones.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ucbus1
PostPosted: Wed Apr 30, 2003 9:23 am    Post subject: Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

Thanks venny...
It is very informative. I have the following code


My open queue looks like this

QueueManager = new MQQueueManager(qMgrName);
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_SET_IDENTITY_CONTEXT;

InputQ = QueueManager.accessQueue( qName, openOptions,qMgrName,null,null);
*******************
My put looks like this

MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_SET_IDENTITY_CONTEXT;
InputQ.put(Msg,pmo);

Quote:
But if your code looks something like this
Code:

MQPutMessageOptions pmo = new MQPutMessageOptions();
DemoQueue.put(inMessage, pmo);


Could you please explain why I am still getting "MQSeriesClient for java". evan after I am having pmo parameter in PUT function

Thanks
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Wed Apr 30, 2003 9:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

The options that you have specified will allow you to set the Identity Context of the Message Descriptor.

You should make the following changes to your code:

int openOptions = MQC.MQOO_OUTPUT | QC.MQOO_SET_ALL_CONTEXT;

pmo.options = MQC.MQPMO_SET_ALL_CONTEXT;

(If you haven't noticed, the options that you specified are different from the above. MQC.MQPMO_SET_ALL_CONTEXT

MQC.MQOO_SET_IDENTITY_CONTEXT )

With this you should be OK.

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ucbus1
PostPosted: Wed Apr 30, 2003 1:18 pm    Post subject: Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

Thanks it did work. But I got some other problem.
When I have changed to "all context" from "ID context".. I am getting invalid date time format on MQ explorer ( when you look under putdatetimestamp column). I guess it is expecting in mm:dd:yy hh:mm:ss format and the default is GMT format. Do you know how to get over the problem??
Thanks
Back to top
View user's profile Send private message Send e-mail
ucbus1
PostPosted: Thu May 01, 2003 6:34 am    Post subject: Reply with quote

Knight

Joined: 30 Jan 2002
Posts: 560

I think I have fixed the problem

To populate the application name, changed put message options from MQC.MQPMO_SET_IDENTITY_CONTEXT to
MQC.MQPMO_SET_ALL_CONTEXT.Since this makes the putDatetime as i/o field, I had to populate putDateTime by coding
Code:

import java.util.*;
private GregorianCalendar putDateTime=new GregorianCalendar();
 Msg.putDateTime=putDateTime;

Venny,
Could you please let me know if my soultion is  right?
Thanks
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 » General IBM MQ Support » MQPUT question
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.