Hi,
We have a custom Java callout we use to validate an inbound call to a Swagger spec before going anywhere near the backend service. recently we've started seeing a lot of compressed class space errors on our message processors.
The code looks like this:
public ValidationCallout() { this.objectMapper = new ObjectMapper(); ResourceMapper resourceMapper = ValidationCallout.class.getClassLoader().getResource(LINK_RELATION_MAPPING_LOCATION) == null ? DefaultResourceMapper.empty() : DefaultResourceMapper.fromFile(LINK_RELATION_MAPPING_LOCATION); this.validator = new DefaultSwaggerValidator(new SwaggerParserYamlImpl().parse(CONTRACT_LOCATION), resourceMapper); } @Override public ExecutionResult execute(MessageContext messageContext, ExecutionContext executionContext) { if (!executionContext.isErrorFlow()) { if (executionContext.isRequestFlow()) { return handleRequest(messageContext, executionContext); } else { return handleResponse(messageContext, executionContext); } } return ExecutionResult.SUCCESS; }
Apigee is erroring at the part it tries to validate the request. If the policy is disabled, the call makes it to the backend and back.
We're running some additional class trace options now to see if ObjectMapper is the culprit, but does the usage of ObjectMapper look suspicious here? Will a new instance of the enclosing class be created each request?
Many thanks