Author |
Message
|
smarriott |
Posted: Tue Dec 02, 2008 1:24 am Post subject: Large message segmentation with .NET |
|
|
Newbie
Joined: 01 Dec 2008 Posts: 3
|
Hi
I need to segment 'large' messages using the MQ v6.0 .NET libraries. The messages are around 6MB in size, and the exception I receive when putting a message is: 2010 - MQRC_DATA_LENGTH_ERROR.
I have implemented segmentation as per the documentation [I cannot post a link to it as this is my first post!] but I suspect I am still subject to the limited queue size.
The code I am using is:
Code: |
Dim MQManager As New IBM.WMQ.MQQueueManager(MQManagerName, MQPropertyStack)
Dim MQQueue As IBM.WMQ.MQQueue = MQManager.AccessQueue(MQOutboundQueueName, IBM.WMQ.MQC.MQOO_OUTPUT)
Dim mqm As New MQMessage
mqm.CharacterSet = IBM.WMQ.MQC.CODESET_UTF
mqm.WriteString("This is a 6MB XML string")
'allow segmentation
mqm.MessageFlags = MQMF_SEGMENTATION_ALLOWED
'put
MQQueue.Put(mqm)
|
I suspect I will need to perform some kind of application segmentation as per the documentation but I cannot seem to implement.
Can anyone advise if my approach is wrong, or offer any examples of how to segment put messages.
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 02, 2008 1:57 am Post subject: Re: Large message segmentation with .NET |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smarriott wrote: |
I suspect I am still subject to the limited queue size.
|
Why is the queue size limited? 6Mb is well within the max message size of WMQv6.
What is the design requirement that has pushed you to segmentation?
(I accept this is not answering the question you're asking - just trying to understand your situation!) _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
zpat |
Posted: Tue Dec 02, 2008 2:07 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
The default max message length on channels tends to be 4 MB. This needs to be increased.
Quote: |
The DataLength parameter is not valid. Either the parameter pointer is not valid, or it points to read-only storage. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable results occur.) This reason can also be returned to an MQ client program on the MQGET, MQPUT, or MQPUT1 call, if the BufferLength parameter exceeds the maximum message size that was negotiated for the client channel.
Corrective action: Correct the parameter. If the error occurs for a WebSphere MQ client program, also check that the maximum message size for the channel is big enough to accommodate the message being sent; if it is not big enough, increase the maximum message size for the channel. |
Last edited by zpat on Tue Dec 02, 2008 3:00 am; edited 1 time in total |
|
Back to top |
|
 |
smarriott |
Posted: Tue Dec 02, 2008 2:53 am Post subject: |
|
|
Newbie
Joined: 01 Dec 2008 Posts: 3
|
Hi
I understand there is a 4MB limit on the queue and channels.
The remote MQ server is not under my control and have been told the queue and channel sizes will not be changed, hence the need for segmentation.
The message sizes could get quite large, possibly upto 20MB in some rare cases. They are just XML messages, so I did suggest zipping the XML before sending but was informed procesing zip files was 'not a good approach to have', is there any reason for this?
Thanks |
|
Back to top |
|
 |
Vitor |
Posted: Tue Dec 02, 2008 3:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smarriott wrote: |
I understand there is a 4MB limit on the queue and channels. |
The limit is 100Mb. It's the default that's 4Mb.
smarriott wrote: |
The remote MQ server is not under my control and have been told the queue and channel sizes will not be changed |
Is this an informed technical decision or management attempting to preserve the status quo in case a change makes the magic go away? In your position I'd push back to the WMQ admin and ask for his reasoning on this.
In extremis he could define a new set of larger channels for you to use.
smarriott wrote: |
I did suggest zipping the XML before sending but was informed procesing zip files was 'not a good approach to have', is there any reason for this? |
It's an uncessary step but it would probably work. There are a number of commercial solutions for moving zip files over WMQ that might be useful in this circumstance. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smarriott |
Posted: Tue Dec 02, 2008 6:20 am Post subject: |
|
|
Newbie
Joined: 01 Dec 2008 Posts: 3
|
Thanks for your advice on this one.
'They' have removed the 4MB channel limit [not sure to what level] and the messages are now going through.
I would still like to work out how to get message segmentation working. |
|
Back to top |
|
 |
|