OpenFeign / OpenFeign/feign

OpenFeign - jaxb - jaxb context preload extremely slow

Open
#1,445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

I am experiencing considerable latency using feign-soap (or feign-jaxb) when:

  • Preloading jaxb context with a list of jaxb classes (1 minute or more):
new JAXBContextFactory.Builder()
          .withMarshallerJAXBEncoding(StandardCharsets.UTF_8.toString())
          .withMarshallerFormattedOutput(true)
          .build(classes);
  • Creating a marshaller/unmarshaller for a previously unloaded class (10-15 seconds):
jaxbContextFactory.createMarshaller(clazz)

The above times exceed by far the time taken to preload the jaxb context using spring-oxm (approximately 10 seconds to preload all classes):

    final Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
    marshaller.setContextPath(clientContextPath);
    return marshaller;

Finally, as an enhancement, I think that it would be helpful to add the ability to preload jaxb context using context path (like in spring-oxm) rather than having to use reflection in order to find all jaxb classes under a specific package.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with JAXBContextFactory.Builder.build(classes) and jaxbContextFactory.createMarshaller(clazz), then compare their behavior with Spring OXM's Jaxb2Marshaller context-path preload. Done should address the reported preload and per-class latency, and clarify whether context-path preloading is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.