Author |
Message
|
e_rajasekar |
Posted: Thu Dec 06, 2007 11:16 am Post subject: How to diable MQ Get |
|
|
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 |
|
 |
bower5932 |
Posted: Thu Dec 06, 2007 11:20 am Post subject: |
|
|
 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 |
|
 |
atheek |
Posted: Thu Dec 06, 2007 11:54 am Post subject: |
|
|
 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 |
|
 |
e_rajasekar |
Posted: Thu Dec 06, 2007 11:57 am Post subject: |
|
|
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 |
|
 |
RogerLacroix |
Posted: Thu Dec 06, 2007 12:02 pm Post subject: Re: How to diable MQ Get |
|
|
 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 |
|
 |
e_rajasekar |
Posted: Thu Dec 06, 2007 1:23 pm Post subject: |
|
|
Newbie
Joined: 06 Dec 2007 Posts: 3
|
Thanks a lot Roger , It helped...
Rajasekar. |
|
Back to top |
|
 |
|