consumer = (MessageConsumer) map.get(d);
}
else
{
final DestinationConfig dConfig = getDestinationConfig(d);
Domain domain;
if (dConfig != null)
{
domain = Domain.getDomain(dConfig.getDomain());
}
else
{
domain = Domain.getDomain(d);
}
if (domain == Domain.QUEUE)
{
try
{
if (selector == null)
{
consumer = getSession().createConsumer(d);
}
else
{
consumer = getSession().createConsumer(d, selector, true);
}
}
catch (NoSuchMethodError ex)
{
log.debug("JMS 1.1 interface failed, trying 1.0.2b");
}
catch (AbstractMethodError ex)
{
log.debug("JMS 1.1 interface failed, trying 1.0.2b");
}
catch (JMSException t)
{
//
// WebSphereMQ hack, it does not correctly support JMS 1.1
if (d.getClass().getName().equals("com.ibm.mq.jms.MQQueue"))
{
log.debug("createConsumer() failed with WMQ via JMS 1.1 call, falling back to 1.0.2b call") ;
}
else
{
throw t;
}
}
if (consumer == null)
{
if (selector == null)
{
consumer = ((QueueSession) getSession()).createReceiver((Queue) d);
}
else
{
consumer = ((QueueSession) getSession()).createReceiver((Queue) d, selector);
}
}
}
else
{
if (dConfig != null && dConfig.isDurable())
{
try
{
if (selector == null)
{
consumer = getSession().createDurableSubscriber((Topic) d, dConfig.getClientID());
}
else
{
consumer = getSession().createDurableSubscriber((Topic) d, dConfig.getClientID(), selector, true);
}
}
catch (NoSuchMethodError ex)
{
log.debug("JMS 1.1 interface failed, trying 1.0.2b");
}
catch (AbstractMethodError ex)
{
log.debug("JMS 1.1 interface failed, trying 1.0.2b");
}
if (consumer == null)
{
if (selector == null)
{
consumer = ((TopicSession) getSession()).createDurableSubscriber((Topic) d, dConfig.getClientID());
}
else
{
consumer = ((TopicSession) getSession()).createDurableSubscriber((Topic) d, dConfig.getClientID(), selector, true);
}
}
}
else
{