Java VM property for Max Buffer Size

50 views
Skip to first unread message

Bhagyashree Jog

unread,
May 16, 2019, 5:11:14 AM5/16/19
to comet...@googlegroups.com
Hello,
I have a Subscriber written using cometd to subscribe to Salesforce Push Topic events. I am getting an error message : java.lang.IllegalArgumentException: Buffering capacity exceeded.

I found this was because my message is large and the default value for max buffer size is 2 MB. I can resolve this by setting the max buffer option like this 
httpTransport.setOption(LongPollingTransport.MAX_BUFFER_SIZE_OPTION, 40*1024*1024);

My question is if there is a Java VM property to set this buffer size so I wont have to change my code since we are on production and any code change will affect our dates

Thanks

--
Bhagyashree  N Jog

Simone Bordet

unread,
May 16, 2019, 6:04:07 AM5/16/19
to cometd-dev
Hi,
No, there is no JVM system property to set the max message size, you
have to change your code.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.

Bhagyashree Jog

unread,
May 16, 2019, 6:32:32 AM5/16/19
to comet...@googlegroups.com
Ohk, follow up question.
We will be taking the input for the buffer size from the customer and mostly the customer will be giving a buffer size as the max expected payload at any time. If I set the buffer size to say 10MB, is that 10MB dedicated to the buffer or it is dynamically allocated.

Basically, I dont want a customer to allocate 1GB size to buffer to be safe and then all the resources being taken up by the buffer

--
--
You received this message because you are subscribed to the Google Groups "cometd-dev" group.
To post to this group, send email to comet...@googlegroups.com
To unsubscribe from this group, send email to cometd-dev-...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cometd-dev

Visit the CometD website at http://www.cometd.org

---
You received this message because you are subscribed to the Google Groups "cometd-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cometd-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cometd-dev/CAFWmRJ2_WavvNSbiLpgk3U%3DcxQTnA-cBATCfE-YM2Q46bJJWXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Bhagyashree  N Jog

Bhagyashree Jog

unread,
May 16, 2019, 6:36:42 AM5/16/19
to comet...@googlegroups.com
Ok, I got the answer to the above question. Its a part of jetty client and will be dynamically allocated and freed. Thanks
--
Bhagyashree  N Jog
Reply all
Reply to author
Forward
0 new messages