|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to read large message = 30MB using MQJMS API. |
« View previous topic :: View next topic » |
Author |
Message
|
abhay09 |
Posted: Thu Jun 15, 2017 8:05 am Post subject: How to read large message = 30MB using MQJMS API. |
|
|
Acolyte
Joined: 31 May 2016 Posts: 66
|
Hi Guys,
I have a system which uses MQJMS API to connect to MQ Queues.
I have a requirement to read large message == 30 MB from mq queue.
I tried.
BytesMessage msg = (JmsBytesMessageImpl) message;
byte[] _readBytes = new byte[(int) (msg.getBodyLength())];
msg.readBytes(_readBytes);
Will that cause memory issues as , we are loading 30 MB in memory or is this correct way?
Please guide some efficient methods to read large message using MQJMS API.
I read MQJAVA API has segmentation and MQJMS API doesnt support that.
Please guide how to read large messages without using segmentation or Message grouping https://www.ibm.com/developerworks/websphere/library/techarticles/0602_currie/0602_currie.html.
Please guide.
Thanks! |
|
Back to top |
|
 |
zpat |
Posted: Thu Jun 15, 2017 11:31 pm Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
These days that is not much memory and you can use 64 bit JVMs.
If the sending application is grouping lots of records/rows into one message, you could ask them to change their design and send each record as a separate message (maybe with the groupid set).
The problem with putting everything into one message is that you introduce a limit which may eventually be reached. _________________ Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error. |
|
Back to top |
|
 |
tczielke |
Posted: Fri Jun 16, 2017 8:07 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
If you do use groups with JMS, just a note that JMSXGroupId is not supported by IBM MQ. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 16, 2017 9:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tczielke wrote: |
If you do use groups with JMS, just a note that JMSXGroupId is not supported by IBM MQ. |
Can you please be more specific as to what you mean with this sentence?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
tczielke |
Posted: Fri Jun 16, 2017 9:25 am Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
JMSXGroupId and JMSXGroupSeq are JMS defined properties. A pure JMS application can use it and expect for messages to be grouped together, if the JMS provider supports these properties. However, these properties are optional and IBM MQ does not support them.
These two properties have a confusing status in the JMS specification, as there is a more general statement that they are optional but also an explicit statement that they are required and all JMS providers must support them. There are also published JMS books (e.g. Java Message Service by Richards, Monson-Haefel, and Chappell) that state these two properties are required, as well. However, I did follow up with someone that supports the JMS specification, and he confirmed IBM's stance is correct that these two properties are optional.
I mention this as I would find this very confusing, if I was a JMS developer. If I worked with ActiveMQ and was transitioning to IBM MQ, I would probably just assume that IBM MQ would support this groups feature of JMS. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jun 16, 2017 5:39 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tczielke wrote: |
JMSXGroupId and JMSXGroupSeq are JMS defined properties. A pure JMS application can use it and expect for messages to be grouped together, if the JMS provider supports these properties. However, these properties are optional and IBM MQ does not support them.
These two properties have a confusing status in the JMS specification, as there is a more general statement that they are optional but also an explicit statement that they are required and all JMS providers must support them. There are also published JMS books (e.g. Java Message Service by Richards, Monson-Haefel, and Chappell) that state these two properties are required, as well. However, I did follow up with someone that supports the JMS specification, and he confirmed IBM's stance is correct that these two properties are optional.
I mention this as I would find this very confusing, if I was a JMS developer. If I worked with ActiveMQ and was transitioning to IBM MQ, I would probably just assume that IBM MQ would support this groups feature of JMS. |
Let's put it somewhat in perspective then.
I'd say IBM does support the properties but does not support automatically grouping the messages for you. You have to code for it yourself. How does that sound?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
tczielke |
Posted: Fri Jun 16, 2017 6:12 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
IBM MQ does support message groups in JMS (you need to use though the IBM MQ JMS Extensions to use it), but it does not support the JMS defined properties of JMSXGroupId and JMSXGroupSeq. If you tell a JMS developer to use message groups, it would be easy for them to assume that they can use JMSXGroupId and JMSXGroupSeq, so I just wanted to highlight that they can not use those JMS defined properties if they are using a JMS provider of IBM MQ. _________________ Working with MQ since 2010. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jun 18, 2017 3:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
tczielke wrote: |
IBM MQ does support message groups in JMS (you need to use though the IBM MQ JMS Extensions to use it), but it does not support the JMS defined properties of JMSXGroupId and JMSXGroupSeq. If you tell a JMS developer to use message groups, it would be easy for them to assume that they can use JMSXGroupId and JMSXGroupSeq, so I just wanted to highlight that they can not use those JMS defined properties if they are using a JMS provider of IBM MQ. |
AFAIK they are supported and mapped. The problem is that you cannot expect automatic group retrieval and need to code for it yourself...  _________________ MQ & Broker admin |
|
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
|
|
|
|