Skip to content
Advertisement

Strange error with WebFlux and Spring-Integration – IndexOutOfBoundsException exceeds maxCapacity

I am in the process of writing a spring-integration flow that is intended to enrich the headers of a message based on the determination if a remote resource actually exists.

Assuming that there is a RESTful endpoint that has an API on it that will locate an object based on a unique name: /mix-entity/name/{mixEntityName}.

This API will return a JSON representation of a MixEntity { "id": 1, "name": "One" }.

In the case that a MixEntity is not found, the result will be an HTTP/404.

The HTTP/200 resultant case works fine with this, the 404 case however is where I’m struggling. I am attempting to deal with the case in a graceful fashion.

My integration flow looks roughly like the following:

JavaScript

When I execute this with a name that does not match up, I would expect an HTTP/404, what I’m getting doesn’t make sense:

JavaScript

I see the HTTP/404 checkpoint, but it looks like the code is failing to write the response content of the HTTP/404 because it is exceeding a buffer.

I brought this up on the gitter site – Artem Bilan indicated that this might be an issue with Netty not so much Spring-Integration.

My intent here is to get to a point where if there is an HTTP/404, I can gracefully handle that and return a default response document { "id": -1, "name": null }.

Any thoughts on this would be greatly appreciated.

OP NOTE: This change was integrated with Spring Integration releases 5.3.9.RELEASE, 5.4.10, and 5.5.3.

Advertisement

Answer

@artem-bilan Helped to identify this issue. This has been addressed with spring-integration#3610

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement