MQJMS2007: failed to send message to MQ queue
843830Jul 14 2009 — edited Jul 18 2009Hello,
I have a batch program running on my system (standalone appln) which sends a message every 30 minutes to client in some other place. Recently I am facing this problem called MQJMS2007 :failed to send to MQ. I am using Websphere MQ API s while sending the message .
Also I want to mention that this problem occurs only when I send messages having large data of the order of (4.2 MB). Initially I thought the problem was occuring because the MQ handler of the client was not able to handle data more than 4 MB. But now even after increasing its size on the client side the same problem is occcuring.
I have a few Queries regarding this problem
1. I am connecting to the remote Queue and create a session on this only once at the start when the system is up and I keep the system on the whole day. The connections and sessions are closed only when I shutdown my system which I do using a command.properties file. So there is no question of closing the session and creating new one for each message. Am I doing the right thing?
2. Also is there a setting in MQ series API to set the message size which I can post on mQ through java code. I have googled a lot and did not find one.
Th code snippet in my connect method in my MQ Manager is as follows.
mqmanager.setConnectionName(connectionName);
mqmanager.setQueueConnection(qcf.createQueueConnection());
mqmanager.mlsQueueConnection.start();
mqmanager.setMlsQueueSession(mlsQueueConnection.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE));
mqmanager.setMlsMessageQueue(mlsQueueSession.createQueue(MLS_QUEUE_NAME));
// Force MQSTR format
((com.ibm.mq.jms.MQQueue) mqmanager.getMessageQueue()).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
mqmanager.setQueueSender(mlsQueueSession.createSender(this.getMlsMessageQueue()));
My send method is as follows.:
public void sendToMq(String fileName, String outputFile) throws JMSException, ServiceException {
final String METHOD_NAME = "sendToMq::";
logger.logDebug(CLASS_NAME + METHOD_NAME, "Starting MQ");
QueueSession someSession = null;
QueueSender someSender = null;
TextMessage message = null;
MqManager manager = MqManager.getInstance();
someSession = manager.getQueueSession();
logger.logDebug(CLASS_NAME + METHOD_NAME, "Getting sender");
someSender = manager.getQueueSender();
message = QueueSession.createTextMessage(outputFile);
mlsQueueSender.send(message);
Can somebody please help. I am on the verge of a nervous breakdown since I am not able to solve this problem from 1 week. I would really appreciate your affaable help..!!!