0

I am developing IBM MQ Connection pool using Apache commons pool (2.4.2 ). IBM MQ JAR version 8.

As part of Pool concept , I need to validate the connection before return to program.

Help me on how to validate IBM MQ connection ?

 Java 8 
 IBM MQ 8  
 Apache commons pool 2.4.2
 JMS 2.0
Gnana
  • 2,130
  • 5
  • 26
  • 57

1 Answers1

0

I assume you are using version 2 of Commons pool. To validate instances before delivering them to pool clients, you need to:

  1. Implement valiateObject() in your PooledObjectFactory.
  2. Set the pool's testOnBorrow and / or testOnCreate property to true.

Setting testOnBorrow to true causes instances to be validated each time they are borrowed from the pool. testOnCreate (new in Pool 2) validates only once, when the instance is created.

Phil Steitz
  • 644
  • 3
  • 10
  • My question was how to validate IBM MQ connection. not in which method do I need to use for validation. Guide me on is there any Option IBM MQ connection give us to validate – Gnana Jul 24 '17 at 21:20