|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJMS2007 Message too big |
« View previous topic :: View next topic » |
Author |
Message
|
robertop |
Posted: Wed Apr 05, 2006 1:07 am Post subject: MQJMS2007 Message too big |
|
|
Newbie
Joined: 05 Apr 2006 Posts: 3
|
We send messages to a MQ Series queue through Weblogic application server. Sending a message, more than 4 MB, we get this error: MQJMS2007.
We changed size parameter on MQ Series to 10 MB but we still get the same error. Anyway we are able to integrate "manually" this message, why do we still experience this error?
We use a startup class in weblogic, does weblogic limit sending too large messages?
Thanks
Roberto |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 05, 2006 2:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What type of connection is weblogic using to connect to the qmgr?
Did you configure a client channel to be used with more than 4 MB ?
And anyway what kind of stuff are you doing on the Web that needs messages over 4 MB? May be there is a different solution that would avoid messages of such a big size.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
robertop |
Posted: Wed Apr 05, 2006 3:01 am Post subject: |
|
|
Newbie
Joined: 05 Apr 2006 Posts: 3
|
we have implemented a startup class to connect to Mq series:
public String startup(String name, Hashtable args) throws Exception
{
StringBuffer msg = new StringBuffer();
Map queues = new HashMap();
openComment( msg );
String qmName = getMqName(args);
msg.append("MQ Queue manager name: ").append(qmName).append(LINE_SEPARATOR);
String jndiName = getMqJndiName(args);
msg.append("MQ Queue manager JNDI name: ").append(jndiName).append(LINE_SEPARATOR);
// get the QUEUE NAMES
// the string is formatted with this pattern:
// QNames=jndi1:name1;jndi2:name2;jndi3:name3
getQueuesNames(args, queues);
String qmHost = getMqHost(args);
String qmPort = (String) args.get(QM_PORT_PROPERTY);
MQQueueConnectionFactory factory = initMQQueueConnectionFactory(qmName, qmHost, qmPort, msg);
msg.append("MQ host: " + qmHost).append(LINE_SEPARATOR);
bindValuesInJndi(qmName, jndiName, factory, msg, queues);
closeComment( msg );
System.out.println(msg.toString());
return msg.toString();
}
/**
* @param qmName
* @param qmHost
* @param qmPort
* @return
* @throws JMSException
*/
private MQQueueConnectionFactory initMQQueueConnectionFactory(String qmName, String qmHost, String qmPort, StringBuffer msg) throws JMSException
{
MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setQueueManager(qmName);
if (!"localhost".equals(qmName))
{
//factory.setTransportType( JMSC.MQJMS_TP_BINDINGS_MQ );
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setHostName(qmHost);
if (qmPort != null)
{
try
{
int portNum = Integer.parseInt(qmPort);
factory.setPort(portNum);
msg.append("MQ port number: ").append(portNum).append(LINE_SEPARATOR);
} catch (NumberFormatException ex)
{
System.out.println("Error in portValue: " + qmPort + ", " + ex.getMessage());
}
}
} else
{
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
}
return factory;
}
/**
* @param qmName
* @param jndiName
* @param factory
* @throws NamingException
* @throws JMSException
*/
private void bindValuesInJndi(String qmName, String jndiName, MQQueueConnectionFactory factory, StringBuffer msg, Map queues) throws NamingException, JMSException
{
InitialContext context = null;
if (!DEBUG)
{
context = new InitialContext();
context.bind(jndiName, factory);
}
//QueueConnection qConnection = factory.createQueueConnection();
//QueueSession qSession = qConnection.createQueueSession( false,
// Session.AUTO_ACKNOWLEDGE );
Iterator queuesItr = queues.keySet().iterator();
while (queuesItr.hasNext())
{
String aJndiName = (String) queuesItr.next();
String aQueueName = (String) queues.get(aJndiName);
MQQueue q = new MQQueue(qmName, aQueueName); //qSession.createQueue(
if (!DEBUG)
{
context.bind(aJndiName, q);
}
msg.append("MQ Queue: ").append(aQueueName).append(", JNDI: ").append(aJndiName).append(LINE_SEPARATOR);
}
if (!DEBUG)
{
context.close();
}
}
/**
* @param args
* @throws Exception
*/
private void getQueuesNames(Hashtable args, Map queues) throws Exception
{
String queuesNames = (String) args.get(QM_QUEUES);
if (queuesNames == null || "".equals(queuesNames))
{
throw new Exception("Queues list not specified: missing or empty parameter " + QM_QUEUES);
}
StringTokenizer queuesNamesTokenizer = new StringTokenizer(queuesNames, ";");
while (queuesNamesTokenizer.hasMoreTokens())
{
String queueDescription = queuesNamesTokenizer.nextToken();
int ddPos = queueDescription.indexOf(':');
if (ddPos <= 0)
{
throw new Exception("Error in definition of the queue '" + queueDescription + "'. Expected value as <jndiName>:<queueName>");
}
String aJndiName = queueDescription.substring(0, ddPos);
if (aJndiName == null || "".equals(aJndiName))
{
throw new Exception("'" + queueDescription + "' queue description not valid");
}
String aQueueName = queueDescription.substring((ddPos + 1), queueDescription.length());
if (aQueueName == null || "".equals(aQueueName))
{
throw new Exception("'" + queueDescription + "' queue description not valid");
}
queues.put(aJndiName, aQueueName);
}
}
/**
*
*/
private void closeComment(StringBuffer msg)
{
msg.append(COMMENT_INDENTIFIER).append(LINE_SEPARATOR);
}
/**
*
*/
private void openComment(StringBuffer msg)
{
msg.append(COMMENT_INDENTIFIER).append(LINE_SEPARATOR);
msg.append(IDENTIFIER).append(LINE_SEPARATOR);
msg.append("Version ").append(VERSION).append(LINE_SEPARATOR);
}
/**
* get from the parameters the name of the MQ Queue if not found, Exception
* is thrown
*
* @param args
* @return the name of the MQ Queue
* @throws Exception
* if not found
*/
private String getMqName(Hashtable args) throws Exception
{
String qmName = (String) args.get(QM_NAME_PROPERTY);
if (qmName == null || qmName.equals(""))
{
throw new Exception(QM_NAME_PROPERTY + " parameter not set or empty");
}
return qmName;
}
private String getMqHost(Hashtable args) throws Exception
{
String mqHost = (String) args.get(QM_HOST_PROPERTY);
if (mqHost == null || "".equals(mqHost))
{
mqHost = "localhost";
}
return mqHost;
}
/**
* get from the parameters the JNDI name of the MQ Queue if not found,
* Exception is thrown
*
* @param args
* @return the JNDI name of the MQ Queue
* @throws Exception
* if not found
*/
private String getMqJndiName(Hashtable args) throws Exception
{
String jndiName = (String) args.get(JNDI_NAME_PROPERTY);
if (jndiName == null)
{
throw new Exception("'" + JNDI_NAME_PROPERTY + "' parameter not set or empty");
}
return jndiName;
} |
|
Back to top |
|
 |
fschofer |
Posted: Wed Apr 05, 2006 3:33 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
robertop wrote: |
We changed size parameter on MQ Series |
Which MQ parameters have you changed
Server Connection Channel
or
Queue Manager
or
Queue
all three have a max length value
Greetings
Frank |
|
Back to top |
|
 |
robertop |
Posted: Wed Apr 05, 2006 3:55 am Post subject: |
|
|
Newbie
Joined: 05 Apr 2006 Posts: 3
|
all those parameters have been changed |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|