}
if (logRCFailures) {
jmse.printStackTrace();
}
NotSupportedException nse = new NotSupportedException(
"MQRA:EC:Error:createRemoteMessageConsumer failed:aborting due to:" + jmse.getMessage());
nse.initCause(jmse);
throw nse;
}
// success
try {
if (this.isDurable) {
this.xas = (com.sun.messaging.jmq.jmsclient.XASessionImpl)
xac.createSession(false, Session.CLIENT_ACKNOWLEDGE);
} else {
if (noAckDelivery) {
this.xas = (com.sun.messaging.jmq.jmsclient.XASessionImpl)
xac.createSession(
com.sun.messaging.jms.Session.NO_ACKNOWLEDGE);
} else {
this.xas = (com.sun.messaging.jmq.jmsclient.XASessionImpl)
xac.createSession(false, Session.CLIENT_ACKNOWLEDGE);
}
}
((com.sun.messaging.jmq.jmsclient.XASessionImpl)xas)._setRAEndpointSession();
if (this.isDurable) {
msgConsumer = xas.createDurableSubscriber((Topic)destination,
aSpec.getSubscriptionName(),
aSpec.getMessageSelector(), false);
} else {
msgConsumer = xas.createConsumer(destination, aSpec.getMessageSelector());
//test to see if Queue is enabled for more than one consumer when InClustered true
if (destination instanceof javax.jms.Queue && aSpec._isInClusteredContainerSet()) {
//Fail activation if it is not
try {
msgConsumer2 = xas.createConsumer(destination, aSpec.getMessageSelector());
msgConsumer2.close();
msgConsumer2 = null;
} catch (JMSException jmse) {
if (xac != null) {
try {
xac.close();
} catch (JMSException jmsecc) {
//System.out.println("MQRA:EC:closed xac on conn creation exception-"+jmsecc.getMessage());
}
xac = null;
}
NotSupportedException nse = new NotSupportedException(
"MQRA:EC:Error clustering multiple consumers on Queue:\n"+jmse.getMessage());
nse.initCause(jmse);
throw nse;
}
}
}
msgListener = new MessageListener(this, this.endpointFactory, aSpec);
//System.out.println("MQRA:EC:Created msgListener");
//msgConsumer.setMessageListener(new MessageListener(this, epFactory, spec));
msgConsumer.setMessageListener(msgListener);
//System.out.println("MQRA:EC:Set msgListener");
//System.out.println("MQRA:EC:Starting Connection");
xac.start();
updateFactoryConsumerTables(this.endpointFactory, aSpec);
} catch (JMSException jmse) {
if (xac != null) {
try {
xac.close();
} catch (JMSException jmsecc) {
//System.out.println("MQRA:EC:closed xac on conn creation exception-"+jmsecc.getMessage());
}
xac = null;
}
NotSupportedException nse = new NotSupportedException(
"MQRA:EC:Error creating Remote Message Consumer:\n"+jmse.getMessage());
nse.initCause(jmse);
throw nse;
}
}