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 » How to diable MQ Get

Post new topic  Reply to topic
 How to diable MQ Get « View previous topic :: View next topic » 
Author Message
e_rajasekar
PostPosted: Thu Dec 06, 2007 11:16 am    Post subject: How to diable MQ Get Reply with quote

Newbie

Joined: 06 Dec 2007
Posts: 3

We use Weblogic MDBs and Foreign JMS configuration to consume msgs from ibm MQ.. We want to stop consuming if we detect some infrastructure issue..

Are there any api's to disable get on MQ...?
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Dec 06, 2007 11:20 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You could always write a program using the Java PCFs to get disable the queue.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
atheek
PostPosted: Thu Dec 06, 2007 11:54 am    Post subject: Reply with quote

Partisan

Joined: 01 Jun 2006
Posts: 327
Location: Sydney

You can disable the mdb from consuming the message. This can be done in weblogic admin console. If WLS 9.2 go to Deployment -> check on <MDB Name> and click on Stop -> When work completes
Back to top
View user's profile Send private message
e_rajasekar
PostPosted: Thu Dec 06, 2007 11:57 am    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2007
Posts: 3

Thanks...

I am new to this...If you could brief about java PCFs or post some references on web, it would be very helpful...
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Dec 06, 2007 12:02 pm    Post subject: Re: How to diable MQ Get Reply with quote

Jedi Knight

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

e_rajasekar wrote:
Are there any api's to disable get on MQ...?

Hi,

Here's a code snippet (from my MQ toolbox) that manages the queue attributes using the standard WMQ base Java:
Code:
import com.ibm.mq.*;

public class MQQueueAttributes
{
   private MQQueueManager     _qMgr = null;
   private MQQueue            _inQ = null;

   /**
    * The constructor
    *
    * @param MQQueueManager Pass in an already connected qmgr object handle
    */
   public MQQueueAttributes(MQQueueManager qMgr)
   {
      super();
      this._qMgr = qMgr;
   }

   /**
    * Open the queue
    *
    * @param String The name of the queue to be opened
    * @return boolean true / false
    */
   public boolean openQueue(String queueName)
   {
      boolean flag = false;
      int openInputOptions  = MQC.MQOO_INQUIRE + MQC.MQOO_SET + MQC.MQOO_FAIL_IF_QUIESCING;

      try
      {
         _inQ = _qMgr.accessQueue( queueName,
                                   openInputOptions,
                                   null,
                                   null,
                                   null );
         flag = true;
      }
      catch (MQException e)
      {
         System.err.println("openQueue: cc="e.completionCode + " : rc=" +e.reasonCode);
         System.err.println("openQueue: MQException: " + e.getLocalizedMessage() +
                                    " : QueueName=" + queueName);
         flag = false;
      }

      return flag;
   }

   /**
    * Close the queue.
    *
    * @return boolean true / false
    */
   public boolean closeQueue()
   {
      boolean flag = false;

      try
      {
         if (_inQ != null)
         _inQ.close();

         flag = true;
      }
      catch (MQException e)
      {
         System.err.println("closeQueue: cc="e.completionCode + " : rc=" +e.reasonCode);
         System.err.println("closeQueue: MQException: " + e.getLocalizedMessage());
         flag = false;
      }

      _inQ = null;
      return flag;
   }

   /**
    * Get inhibit Get state of a queue
    *
    * @return int
    * @throws MQException
    */
   public int getInhibitGet() throws MQException
   {
      return _inQ.getInhibitGet();
   }

   /**
    * Set inhibit Get state of a queue
    *
    * @param int
    * @throws MQException
    */
   public void setInhibitGet(int type) throws MQException
   {
      _inQ.setInhibitGet(type);
   }

   /**
    * Get inhibit Put state of a queue
    *
    * @return int
    * @throws MQException
    */
   public int getInhibitPut() throws MQException
   {
      return _inQ.getInhibitPut();
   }

   /**
    * Set open output count
    *
    * @param int
    * @throws MQException
    */
   public void setInhibitPut(int type) throws MQException
   {
      _inQ.setInhibitPut(type);
   }

   /**
    * Get the queue depth.
    *
    * @return int
    * @throws MQException
    */
   public int getCurrentDepth() throws MQException
   {
      return _inQ.getCurrentDepth();
   }

   /**
    * Get open input count
    *
    * @return int
    * @throws MQException
    */
   public int getOpenInputCount() throws MQException
   {
      return _inQ.getOpenInputCount();
   }

   /**
    * Get open output count
    *
    * @return int
    * @throws MQException
    */
   public int getOpenOutputCount() throws MQException
   {
      return _inQ.getOpenOutputCount();
   }
}


Hope that helps.


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
e_rajasekar
PostPosted: Thu Dec 06, 2007 1:23 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2007
Posts: 3

Thanks a lot Roger , It helped...

Rajasekar.
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 » How to diable MQ Get
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.