Author |
Message
|
jadaaih |
Posted: Wed Sep 10, 2008 12:46 am Post subject: Maximum message size? |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Hi All,
I am new to MQ and just started this morning, so forgive me if my question is lame or dumb.
I want to read a file somewhere around 10 MB as a MQMessage and send put it in a queue.
But when I am trying to do this via Java API provided in MQ, I am getting MQJE001: Completion Code 2, Reason 2010
I tried maximizing the message size through the explorer in properties > Max Message Length and set it to 104856700.
Even then it does not seem working and shows up the exception.
Here is the code snippet
MQMessage msg = new MQMessage();
baos = MQSUtil.readFile("C:/Test.doc");
msg
.write(baos.toByteArray());
MQPutMessageOptions mqpo = new MQPutMessageOptions(); //Blank options
defaultQ.put(msg, mqpo); //Put the message in queue
Could you please let me know where am I going wrong? Also could you please point me documentations page for MQ 6?
TIA,
Jade |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Sep 10, 2008 1:07 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
max msg length can be set on the queuemanager, on the queue, on the channel. did you set it in every place you needed it? _________________ Regards, Butcher |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 2:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You are probably missing some setup on your clientsvr channel on the client side. Try using a channel table (having both the svrconn and the clientconn set the max msgsize) and see if it makes a difference...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 3:05 am Post subject: |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Yes...Its set in all the three places...even then its the same issue  |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 3:18 am Post subject: |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Sorry for being dumb again...where is the svrconn and channel table stuff you had mentioned...Is it in MQ Explorer? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 3:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jadaaih wrote: |
Sorry for being dumb again...where is the svrconn and channel table stuff you had mentioned...Is it in MQ Explorer? |
Check the intercommunications and clients manuals here
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 5:52 am Post subject: |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
I tried specifying the max limit in all possible plays through websphere MQ explorer for the qmanager, queue and channel also in client connection and server connection
Still its same issue...
The following is my code
MQEnvironment.hostname = MQSConstants.MQ_HOST;
MQEnvironment.channel = MQSConstants.MQ_CHANNEL_NAME;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES);
mqManager = new MQQueueManager(MQSConstants.MQ_QUEUE_MANAGER);
openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
System.out.println("[ Open Options : "+openOptions+"]");
defaultQ = mqManager.accessQueue("default",
openOptions);
// Framing message to send
MQMessage msg = new MQMessage();
//5MB file
baos = MQSUtil.readFile("C:/Test.doc");
msg.write(baos.toByteArray());
MQPutMessageOptions mqpo = new MQPutMessageOptions(); //Blank options
defaultQ.put(msg); //Put the message in queue
// Getting the message from queue
MQMessage rmsg = new MQMessage();
rmsg.messageId = msg.messageId;
MQGetMessageOptions mqgo = new MQGetMessageOptions();
defaultQ.get(rmsg, mqgo);
System.out.println("[Received : "+rmsg.readUTF()+"]");
// Close the queue
defaultQ.close();
// Disconnect from the mq manager
mqManager.disconnect();
Kindly lemme know what I am missing out  |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 2:13 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like you are using the default client end of a channel connection. This is limited @ 4MB. You need to specify the max msg length on your connection information to be able to go above. Verify in the programming manual.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 8:06 pm Post subject: |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
fjb_saper wrote: |
Looks like you are using the default client end of a channel connection. This is limited @ 4MB. You need to specify the max msg length on your connection information to be able to go above. Verify in the programming manual.
Enjoy  |
I guess this the application programming manual
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/csqzal05.pdf
I could see chapter 10 page 135 speaking about the message length...I am very sorry to keep coming back around I am still unclear how to do it even after reading the manual... |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 8:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jadaaih wrote: |
fjb_saper wrote: |
Looks like you are using the default client end of a channel connection. This is limited @ 4MB. You need to specify the max msg length on your connection information to be able to go above. Verify in the programming manual.
Enjoy  |
I guess this the application programming manual
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/csqzal05.pdf
I could see chapter 10 page 135 speaking about the message length...I am very sorry to keep coming back around I am still unclear how to do it even after reading the manual... |
The key parts are qmgr, dlq, q, chl
With that you should be able to put your message. However for the changes to take effect you might have to restart the qmgr or at least stop and start the chl.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 8:33 pm Post subject: Got it working!! |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Finally I got it working, these are the things I did,
- I created a new queue and set the max length of the message as 10MB
- Wrote the file to be sent in queue as bytes.
- Read them back as bytes and wrote back to a file.
Its working...
However, I would like to know or still analyzing on,
- The new queue I added is not visible in MQExplorer, however when I tried to add queue with same name it said the object existed...That's how I came to know the queue was existing there.
- Why was it not working for the default queue even though the message size was set to the maximum. I guess there was no difference between the default and the newly created queue except for the names..all other parameters seemed the same
Thanks again guys..!! Great place for beginners like me!! |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 8:40 pm Post subject: Found the issue! |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Yes.. I found the issue...
The default queue persistence was set to persistence...and thats why it was not working...But I still don't whats the usage for that parameter. Could any one brief on it please? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 10, 2008 9:26 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You did not specify which type of logging you are using (circular / linear).
In any case what I suspect is that you might get rolled back on a persistent message because you do not have enough log space (<= 10 MB you need more) to have the message under transactional control...
A look at the qmgr logs should show you messages to that effect.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jadaaih |
Posted: Wed Sep 10, 2008 9:44 pm Post subject: |
|
|
Apprentice
Joined: 10 Sep 2008 Posts: 25
|
Well I guess the logging is the default one...I did not change any in it...It should be circular... |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 11, 2008 2:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jadaaih wrote: |
Well I guess the logging is the default one...I did not change any in it...It should be circular... |
With default logging you also might be a little bit short in total logging space as you have to account for everything else that is going on, on the qmgr, at the same time.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|