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 API Support » User ID at new PCFMessageAgent()?

Post new topic  Reply to topic
 User ID at new PCFMessageAgent()? « View previous topic :: View next topic » 
Author Message
Suessli
PostPosted: Tue Feb 24, 2009 1:09 am    Post subject: User ID at new PCFMessageAgent()? Reply with quote

Novice

Joined: 29 Jan 2008
Posts: 15

Hi everyone,

maybe I am blind or maybe my knowledge about mq ist still at very low level but I am not able to connect to a queue manager via PCF command from the Java API.

I am trying to connect as follows.

Code:

...
System.out.print ("Connecting to queue manager at " + host + ":" + port + " over channel " + channel + "... ");
agent = new PCFMessageAgent (host, Integer.parseInt (port), channel);
System.out.println ("Connected.");
...


I am getting MQRC 2009 and it is ok because BlockIP2 is blocking the connection because no user is send. And now the big question: How do I send user id to the queue manager via PCF? I am not able to find any examples in this forum or on the internet :-/

EDIT: I am using MO71 while logged in with same user name and connections via same channel and with BlockIP2 are possible. But why there is no user send when I am executing my Java code in eclipse? BlockIP2 log says that no user is sent and it is blocking the connection.

EDIT: Doh!

Code:

MQEnvironment.userID = "user";


Now the question is: if I want to run this under user that executes my application, how it is done then?
_________________
Suessli
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Feb 24, 2009 5:03 am    Post subject: Re: User ID at new PCFMessageAgent()? Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Suessli wrote:
Now the question is: if I want to run this under user that executes my application, how it is done then?


You have to figure out how to write Java code that will ask the OS what user is running the current process.

The JVM will not do this for you, nor will the MQ libraries unless you are making a Bindings connection.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Wed Feb 25, 2009 1:26 pm    Post subject: Re: User ID at new PCFMessageAgent()? Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Suessli wrote:
Now the question is: if I want to run this under user that executes my application, how it is done then?

Its called: RTM Or use Google!

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » User ID at new PCFMessageAgent()?
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.