Paul Coombes created CAMEL-17337:
------------------------------------

             Summary: FhirComponent regression between 2.2x and 3.x releases
                 Key: CAMEL-17337
                 URL: https://issues.apache.org/jira/browse/CAMEL-17337
             Project: Camel
          Issue Type: Bug
          Components: camel-fhir
    Affects Versions: 3.x
            Reporter: Paul Coombes


In the 3.x branches, the FhirComponent contains a FhirConfiguration property 
which results in the getClient method creating a new client from the method 
supplied configuration due to the configuration property never being 
initialised.
{code:java}
@Component("fhir")
public class FhirComponent extends AbstractApiComponent<FhirApiName, 
FhirConfiguration, FhirApiCollection> {

    @Metadata(label = "advanced")
    FhirConfiguration configuration;
{code}
This property appears to shadow a property of the same name on 
AbstractApiComponent
{code:java}
public abstract class AbstractApiComponent<E extends Enum<E> & ApiName, T, S 
extends ApiCollection<E, T>>
        extends DefaultComponent {

    @Metadata(label = "advanced", description = "Component configuration")
    protected T configuration;
{code}
This is an issue for me as I am attempting to register a IClientInterceptor to 
help with a SMART on FHIR workflow, which no longer works as the configuration 
supplied during class construction is ignored and a IGenericClient is never 
persisted.

To work around the issue in the interim, creating a component that extends 
FhirComponent, overriding the getClient method to utilise the configuration 
from AbstractApiComponent appears to resolve the issue.

Assuming I'm not missing anything obvious regarding the purpose for the 
configuration property on the FhirComponent class, and if desired, am more than 
happy to submit a PR with a fix.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to