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 » Can I set JMSXUserID in Code?

Post new topic  Reply to topic
 Can I set JMSXUserID in Code? « View previous topic :: View next topic » 
Author Message
granthmuk
PostPosted: Thu Oct 25, 2001 2:14 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2001
Posts: 38
Location: Edinburgh, Scotland

As the subject suggests I am trying to set the JMSXUserID property from within my java code. This is essentially for a JMS test driver program in which I nead a great deal of flexibility. I've tried the following

outMessage.setStringProperty("JMSXUserId", "myuserid");

but I get

caught JMSException in putMessage(): javax.jms.MessageFormatException: MQJMS1058: Invalid message property name: JMSXUserId

Anyone got any Ideas? Is this allowed by the IBM JMS implementation and if so how is it done? I've searched the documentation and found nothing of any use. Cheers.
Back to top
View user's profile Send private message
kolban
PostPosted: Thu Oct 25, 2001 7:56 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

If your posting is correct, it may be the same typo in your code as the posting.

You have JMSXUserId.

The manuals shows JMSXUserID

On yer-sel big man

(ex-Glaswegian, now in Texas)

[ This Message was edited by: kolban on 2001-10-25 20:57 ]
Back to top
View user's profile Send private message
kolban
PostPosted: Fri Oct 26, 2001 11:08 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

For grins, I tried this test myself and got exactly the same error (JMSXUserId and JMSXUserID). Doing a trace seems to show that JMSXUserID is not a valid property name!! Looking further ...


Doh!!!! ... Head smack ... this is a read-only property ... it may be queried on an incoming message but may not be set on an outgoing message. It is set in the outgoing message by the send() method of the queueSender object from the current userid. It doesn't look like it is over-ridable.


[ This Message was edited by: kolban on 2001-10-26 12:12 ]
Back to top
View user's profile Send private message
granthmuk
PostPosted: Tue Oct 30, 2001 2:15 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2001
Posts: 38
Location: Edinburgh, Scotland

Cheers Kolban, Seems that the IBM JMS is a bit inflexible in this area. I'll raise a PMR and see what Hursley have to say. This could have implications in future applications where our JMS messages are initiated by servlets. We'd definitely wan't to set the useridentifier.

(ex-Greenockian now in Edinburgh)


[ This Message was edited by: granthmuk on 2001-11-01 01:14 ]
Back to top
View user's profile Send private message
barberis
PostPosted: Wed Oct 31, 2001 1:16 pm    Post subject: Reply with quote

Newbie

Joined: 30 Oct 2001
Posts: 1
Location: barberis

I experienced this same problem myself.
One way around it was to set the user ID
and password when I created the queue
connection. When I subsequently created
a message, the JMSXUserID property was
properly set by MQ.


// Create a queue connection.
QueueConnection conn =
qcf.createQueueConnection(
userID,
password);


Back to top
View user's profile Send private message
granthmuk
PostPosted: Thu Nov 01, 2001 1:13 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2001
Posts: 38
Location: Edinburgh, Scotland

Cheers barberis, This works OK.
Back to top
View user's profile Send private message
babas1
PostPosted: Wed Feb 27, 2002 1:34 am    Post subject: Reply with quote

Newbie

Joined: 26 Feb 2002
Posts: 3

Hi still with that JMSXUserID read only field problem !!!

Is there something new about it ?
As for my program, i want to change userid from one message to one another... It is not sufficient to have always the same user id while the connection lasts (same as program time life) !!!

Please help
Back to top
View user's profile Send private message
srinivasakj
PostPosted: Wed Jun 21, 2006 1:47 am    Post subject: setting JMSXUserId to a userId that is not present on Server Reply with quote

Newbie

Joined: 19 Jan 2006
Posts: 6

We have a issue with our JMS Application, which is trying to set the JMSxUserID property in the message and is failing. We saw the IBM site got to know that, we cannot set this field, since it is read-only. We used MQEnvironment.userid = "test" to set the userid. But here the problem is the userID that we set is not present in the server and hence it will throw the exception. When i code the above statement after connecting to Qmgr it is not setting the userid.

Please let me know if you any ideas about this.

Thanks
Srinivasa KJ
Back to top
View user's profile Send private message
briancop
PostPosted: Wed Jun 21, 2006 4:43 am    Post subject: Reply with quote

Apprentice

Joined: 04 Apr 2005
Posts: 28
Location: Hursley, UK

babas1 wrote:
It is not sufficient to have always the same user id while the connection lasts (same as program time life) !!!


Your connection doesn't have to have the same lifetime as your program. There is no reason why you can't have multiple connections from a single program, each with different user credentials, either in parallel or sequentially. I agree, for performance, a single connection is best, but if you want to change user between messages, you could use a connection per message or perhaps cache connections, one per user that needs to send messages.
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 » Can I set JMSXUserID in Code?
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.