|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Application Programmer Help..............Please | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | offshore | 
		  
		    
			  
				 Posted: Wed Nov 12, 2003 10:50 am    Post subject: Application Programmer Help..............Please | 
				     | 
			   
			 
		   | 
		 
		
		    Master
 
 Joined: 20 Jun 2002 Posts: 222
  
  | 
		  
		    
			  
				All,
 
 
I downloaded the MA17 message handler support pac from IBM. 
 
 
We recently moved to clustering on z/OS to help support sysplex environment and the program no longer will read messages off the queues, since we had to redefine them as cluster queues.
 
 
I've been trying to change the program to read cluster queues, but I'm not having any luck.  (I'm not much of an application programmer.) The program seems to be doing an inquiry on the queue to determine its type.
 
 
Below is posted the section that I think is doing the inquiry check.  Any help on how to get it to read the cluster queue would be appreciated. 
 
 
Surely its possible to get the program to read messages of a cluster q?
 
 
TIA
 
 
 
 INQUIRE-Q SECTION.                                              
 
 *---------------------------------------------------------------*
 
 *  This section opens the specified queue to inquire on the     *
 
 *  queue and definition type. The definition type is required   *
 
 *  to distinguish local queues from dynamic queues created when *
 
 *  a model queue is opened for inquiry. If the queue is unable  *
 
 *  to be opened or the inquiry shows the queue is not a local   *
 
 *  queue, an appropriate error message is issued.               *
 
 *---------------------------------------------------------------*
 
 *                                                                
 
      MOVE 2                    TO W02-SELECTORCOUNT.             
 
      MOVE 2                    TO W02-INTATTRCOUNT.              
 
      MOVE ZEROES               TO W02-CHARATTRLENGTH.            
 
 *                                                               *
 
 *     Set the open options to inquire on the queue.             *
 
 *                                                               *
 
      MOVE MQOT-Q               TO MQOD-OBJECTTYPE.               
 
      MOVE W01-QNAME            TO MQOD-OBJECTNAME.               
 
      MOVE MQOO-INQUIRE         TO W02-OPENOPTIONS.               
 
 *                                                                
 
      CALL 'MQOPEN' USING W01-HCONN                               
 
                          MQOD                                    
 
                          W02-OPENOPTIONS                         
 
                          W02-QMGRHOBJ                            
 
                          W02-COMPCODE                            
 
                          W02-REASON.                             
 
 *                                                               *
 
 *   If the open was unsuccessful, then issue an appropriate     *
 
 *   error message and return the reason code.                   *
 
 *                                                               *
 
      IF (MQCC-OK NOT = W02-COMPCODE) THEN                        
 
         MOVE 'Unable to open queue.'                             
 
                                                 TO W00-ERRORMSG  
 
         PERFORM ERROR-MESSAGE                                    
 
         GO TO INQUIRE-Q-EXIT.                                    
 
 *                                                               *
 
 *      Set the inquire selectors for queue type and queue       *
 
 *      definition type.                                         *
 
 *                                                               *
 
      MOVE MQIA-Q-TYPE           TO W02-SELECTORS(1).             
 
      MOVE MQIA-DEFINITION-TYPE  TO W02-SELECTORS(2).             
 
 *                                                                
 
      CALL 'MQINQ' USING W01-HCONN                                
 
                         W02-QMGRHOBJ                             
 
                         W02-SELECTORCOUNT                        
 
                         W02-SELECTORS-TABLE                      
 
                         W02-INTATTRCOUNT                         
 
                         W02-INTATTRS-TABLE                       
 
                         W02-CHARATTRLENGTH                       
 
                         W02-CHARATTRS                            
 
                         W02-COMPCODE                             
 
                         W02-REASON.                              
 
 *                                                               *
 
 *     If the inquire was successful then check whether the      *
 
 *     queue is local. If not, issue an error message and set    *
 
 *     W02-REASON to a negative value for return to caller.      *
 
 *     If the inquire is unsucessful, then determine whether     *
 
 *     the reason for failure was because we inquired on an      *
 
 *     attribute not applicable to local queues or some other    *
 
 *     reason, and issue an appropriate error message.           *
 
                                                                  
 
      IF (MQRC-NONE = W02-REASON) THEN                            
 
         IF ( (W02-INTATTRS(1) NOT = MQQT-LOCAL) OR             
 
              (W02-INTATTRS(2) NOT = MQQDT-PREDEFINED) ) THEN     
 
            MOVE 'Queue Name is not a local queue.'     
 
                                                 TO W01-MESSAGE   
 
            PERFORM PRINT-MESSAGE                                 
 
            MOVE -1 TO W02-REASON                                 
 
            GO TO INQUIRE-Q-CLOSE                                 
 
         ELSE                                                     
 
            GO TO INQUIRE-Q-CLOSE                                 
 
         END-IF                                                   
 
      END-IF                                                      
 
      IF (MQRC-SELECTOR-NOT-FOR-TYPE = W02-REASON) THEN           
 
         MOVE 'Queue Name is not a local queue.'       
 
                                                 TO W01-MESSAGE   
 
         PERFORM PRINT-MESSAGE                                    
 
         MOVE -1 TO W02-REASON                                    
 
         GO TO INQUIRE-Q-CLOSE                                    
 
      ELSE                                                        
 
         MOVE 'Unable to inquire whether queue is local.'         
 
                                                 TO W00-ERRORMSG  
 
         PERFORM ERROR-MESSAGE                                    
 
         MOVE -1 TO W02-REASON                                    
 
         GO TO INQUIRE-Q-CLOSE                                    
 
      END-IF.                                                     
 
 *                                                               *
 
 *              Close the queue.                                 *
 
 *                                                               *
 
 * | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | EddieA | 
		  
		    
			  
				 Posted: Wed Nov 12, 2003 11:10 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi
 
 Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles 
  | 
		  
		    
			  
				The concept of Cluster Queues is really for the sending application.  It can send a message to any the Queues and MQ will take care of the balancing.
 
 
When you come to GET a message off a Queue, it doesn't matter if the Queue is clustered or not.  The only important thing, is that the Queue is LOCAL to the Queue Manager you connect to.
 
 
Cheers, _________________ Eddie Atherton
 
IBM Certified Solution Developer - WebSphere Message Broker V6.1
 
IBM Certified Solution Developer - WebSphere Message Broker V7.0 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | offshore | 
		  
		    
			  
				 Posted: Wed Nov 12, 2003 11:25 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Master
 
 Joined: 20 Jun 2002 Posts: 222
  
  | 
		  
		    
			  
				I understand your point. 
 
 
The problem is the program will not perfrom a read/inq of a queue with a cluster attribute.
 
 
When the program is invoked its askes for 2 things 1) Queue Manger and 2) Name of queue to browse.
 
 
Evidently, the program does an MQINQ of the queue and passes the values.  If the queue has an attribute of "cluster" the program quits with the message 'Queue Name is not a local queue'
 
 
Background Info
 
 
I would like to know how to get to accept a local q w/ cluster attribute.  Because its on a z/OS system clustered between 2 lpars its a little different than most typical cluster setups.  
 
 
LPAR1 - Primary
 
Q1 defined as a local cluster queue
 
 
LPAR2
 
Also has Q1 defined as local cluster queue.
 
 
We have an NT qmanger (with an exit) that sends all messages to LPAR1, unless LPAR1 goes down. Then, the exit is invoked and messages are routed to LPAR2 until LPAR1 is back up.
 
 
Confusing??...sorta | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | offshore | 
		  
		    
			  
				 Posted: Wed Nov 12, 2003 12:00 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Master
 
 Joined: 20 Jun 2002 Posts: 222
  
  | 
		  
		    
			  
				Well,
 
 
I figured it out.    Down in the program I commented out for it to do an INQUIRY.  This way it just does the open w/o doing a check for what type of queue it is. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | PeterPotkay | 
		  
		    
			  
				 Posted: Wed Nov 12, 2003 4:41 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Poobah
 
 Joined: 15 May 2001 Posts: 7723
  
  | 
		  
		    
			  
				If you want to MQINQ against a queue that is clustered, you must also open the queue with the SET option, even though you don't intend to MQSET it.
 
 
This is buried in one of the manuals. Something about the code makes it bind to a particular instance of the queue when you specify SET on the open option. INQ option only won't bind you, and hence your MQINQ call doesn't work right. _________________ Peter Potkay
 
Keep Calm and MQ On | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |