Hi all,
I'm writing to you about this bug: https://bugzilla.redhat.com/show_bug.cgi?id=887320
For those not aware of it, an OutOfMemoryError is raised on the agent when you try to add a child resource of type deployment to a managed AS7 instance.
It happens because the AS7 plugin uses HttpUrlConnection to communicate with AS7 HTTP management interface.
Basically, HttpUrlConnection waits for the request payload to be fully loaded in memory before it tries to contact the server. It does that to be able to resend the request payload if the server ask for redirection or start an authentication challenge.
While this is acceptable for small payloads, it's not suitable for large file uploads (in our case a 42M WAR upload triggers the OutOfMemoryError).
For large file uploads, HttpUrlConnection provides a streaming mode. But in streaming mode it does neither support redirection nor authentication. I tried to use streaming mode to make a fix yesterday and it's really not working (BTW, sorry for the patch revert waltz).
I can see two options:
#1 Keep HttpUrlConnection as communication layer In this case, the streaming mode is mandatory. This means we should maintain our own authentication challenge code and set authentication headers manually. #2 Use HttpClient as communication layer
Personally, I prefer #2
Importing HttpClient in AS7 plugin will increase the plugin dependencies list. But I think it's a small price to pay compared to the efforts we would spend maintaining our own authentication and redirection code.
What do you think?
Thanks Thomas