project-husky / husky

Health Usability Key
https://project-husky.github.io/husky/
Eclipse Public License 1.0
15 stars 8 forks source link

Some issues with the service API #119

Open qligier opened 5 months ago

qligier commented 5 months ago

OWT has encountered performance issues with the service API. I had a look and found a few areas of improvement (for performance and code simplification).

In HuskyWebServiceClient, a new ProducerTemplate is created for each transaction, that is extremely expensive and inefficient. Per Camel's documentation, a single instance should be (lazily) created, kept and shared for the entire life of the application (or at least the entire life of the HuskyWebServiceClient instance).

In HuskyWebServiceClient, there's no need to manually set the Accept and Content-Type headers, Camel will take care of it.

In HuskyWebServiceClient, some transactions are needlessly marshalled/unmarshalled (e.g. ITI-44), Camel will also take care of it.

In HuskyWebServiceClient, we should not set the interceptor if we are not in debug mode.

In HuskyWebServiceClient, the AuditContext is required in the constructor but isn't used; a different AuditContext may be used by IPF (depending on it that CamelContext is the same that was registered as a bean or not).

I'm not sure why we need to manually create an instance of HuskyWebServiceClient, HuskyService could do it by itself.

msmock commented 1 month ago

We are aware of problems with the convenience api and therefore switched to the service api. I'm sorry but I can help on issues with the service api, but not with the convenience api, which should be deleted from my point of view.

qligier commented 1 month ago

@msmock Sorry, the HuskyWebServiceClient is the new service API, not the old convenience API

msmock commented 1 month ago

Dear Quentin, if you know all the solutions to the problems, I suggest you to do the changes, at least if the changes are as simple as it sounds. Ok, for you?