|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Monitor MQ (.Net Vs Java) | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | Shahid.Hussain | 
		  
		    
			  
				 Posted: Sun Jan 16, 2011 7:25 am    Post subject: Monitor MQ (.Net Vs Java) | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 18 Mar 2009 Posts: 13
  
  | 
		  
		    
			  
				Hi, 
 
 
i am writing one small application to connect to remote queue manager to get the status of all channels (using PCFs). 
 
 
i have written the code in java and Vb.net. 
 
Java application is able to connect to the remote queue manager and give me statuses of all channels. while vb.net application is not able to connect to the remote queue manager and giving me MQRC_NOT_AUTHORIZED error message.
 
 
trying both applications from same machine.
 
 
Java Code
 
======
 
MQEnvironment.hostname = "RemoteHOst";
 
MQEnvironment.port = 1414;
 
MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
 
 
			
 
MQQueueManager qm = new MQQueueManager("RemoteQM");
 
agent = new PCFMessageAgent(qm);			
 
 
System.out.println ("Connected...");
 
 
request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS);
 
  request.addParameter (CMQCFC.MQCACH_CHANNEL_NAME, "CHANNELNAME");
 
		      		        
 
int[] attrs = {CMQCFC.MQCACH_CHANNEL_NAME}; 
 
		    request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, attrs);
 
 
System.out.print ("Sending PCF request... ");
 
responses = agent.send (request);
 
System.out.println ("Received reply.");
 
 
// Display the results
 
 
for (int i = 0; i < responses.length; i++)
 
{
 
String         name1 = responses [i].getStringParameterValue (CMQCFC.MQCACH_CHANNEL_NAME);
 
int         name = responses [i].getIntParameterValue (CMQCFC.MQIACH_CHANNEL_STATUS);
 
 
System.out.println ("Chanel Status " + name1  + " " + name);
 
}
 
 
// Disconnect
 
 
System.out.print ("Disconnecting... ");
 
agent.disconnect ();
 
System.out.println ("Done.");
 
 
 
 
VB.NET Code
 
==========
 
 MQEnvironment.Hostname = "RemoteHost"
 
MQEnvironment.Port = "1414"
 
MQEnvironment.Channel = "SYSTEM.DEF.SVRCONN"
 
MQEnvironment.properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED)
 
 
 
 
Dim agent As PCFMessageAgent
 
Try
 
            agent = New PCFMessageAgent(txtQM.Text)
 
        Catch ex As Exception
 
            txtMsgs.Text = ex.Message
 
            Exit Sub
 
        End Try
 
 
 
 
        Me.Text = "Connected"
 
        Dim request As PCFMessage = New PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS)
 
 
        request.AddParameter(CMQCFC.MQCACH_CHANNEL_NAME, "CHANNELNAME")
 
 
        Dim attrs() As Int32 = {CMQCFC.MQCACH_CHANNEL_NAME}
 
        request.AddParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, attrs)
 
 
        Dim responses() As PCFMessage = agent.Send(request)
 
 
any help would be really appricated. 
 
 
Shahid | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Sun Jan 16, 2011 1:00 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				Don't use SYSTEM.DEFAULT.SVRCONN! Use a proper channel with SSL and set the MCAUser....   _________________ MQ & Broker admin | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | Vitor | 
		  
		    
			  
				 Posted: Sun Jan 16, 2011 6:42 pm    Post subject: Re: Monitor MQ (.Net Vs Java) | 
				     | 
			   
			 
		   | 
		 
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| Shahid.Hussain wrote: | 
   
  
	
 
i have written the code in java and Vb.net. 
 
Java application is able to connect to the remote queue manager and give me statuses of all channels. while vb.net application is not able to connect to the remote queue manager and giving me MQRC_NOT_AUTHORIZED error message. | 
   
 
 
 
Java and .Net use 2 different ways of passing users, as discussed here before. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |