Author |
Message
|
granthmuk |
Posted: Thu Oct 25, 2001 2:14 am Post subject: |
|
|
 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 |
|
 |
kolban |
Posted: Thu Oct 25, 2001 7:56 pm Post subject: |
|
|
 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 |
|
 |
kolban |
Posted: Fri Oct 26, 2001 11:08 am Post subject: |
|
|
 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 |
|
 |
granthmuk |
Posted: Tue Oct 30, 2001 2:15 am Post subject: |
|
|
 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 |
|
 |
barberis |
Posted: Wed Oct 31, 2001 1:16 pm Post subject: |
|
|
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 |
|
 |
granthmuk |
Posted: Thu Nov 01, 2001 1:13 am Post subject: |
|
|
 Apprentice
Joined: 16 May 2001 Posts: 38 Location: Edinburgh, Scotland
|
Cheers barberis, This works OK. |
|
Back to top |
|
 |
babas1 |
Posted: Wed Feb 27, 2002 1:34 am Post subject: |
|
|
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 |
|
 |
srinivasakj |
Posted: Wed Jun 21, 2006 1:47 am Post subject: setting JMSXUserId to a userId that is not present on Server |
|
|
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 |
|
 |
briancop |
Posted: Wed Jun 21, 2006 4:43 am Post subject: |
|
|
 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 |
|
 |
|