Getting MQJCA1025 error while starting up the Asynchronous Listener/reader on IBM-MQ as -
com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1025: The message consumer must not have a message listener. An application attempted to set a message listener for a JMS message consumer. This exception occurs only if the application is running in a managed environment. Modify the application so that it does use a message listener.
Below is the init method where listener setup is done -
public void init(){
ConnectionFactory qConnectionFactory = null;
Connection connection = null;
try{
Context ctx = new InitialContext();
qConnectionFactory = (ConnectionFactory) ctx.lookup("java:jboss/Connection");
Destination receiverQueue = null;
if(null != qConnectionFactory){
connection = qConnectionFactory.createConnection();
if(null !=connection){
receiverQueue = (Destination) ctx.lookup("java:jboss/RESPONSE");
if(null != receiverQueue){
Session session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
if(null != session){
MessageConsumer consumer = session.createConsumer(receiverQueue);
consumer.setMessageListener(this);
connection.start();
}
}
}
}
}
catch(Exception e){
System.out.println(e);
}
}
IBM resolution at http://www-01.ibm.com/support/docview.wss?uid=swg21610734 doesn't mentions the fix to be made at listener/client side