Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove warnings "Bean 'citrusSpringConfig' and Bean 'citrusReferenceResolver' not eligible for getting processed by all BeanPostProcessors" #1185

Open
pablopaul opened this issue Jun 26, 2024 · 0 comments

Comments

@pablopaul
Copy link

pablopaul commented Jun 26, 2024

Citrus Version
4.2.1

Question
I get the following warnings when running my citrus test:

WARN  PostProcessorChecker| Bean 'citrusSpringConfig' of type [org.citrusframework.config.CitrusSpringConfig$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [citrusComponentInitializer] is declared through a non-static factory method on that class; consider declaring it as static instead.

WARN  PostProcessorChecker| Bean 'citrusReferenceResolver' of type [org.citrusframework.context.SpringBeanReferenceResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [citrusComponentInitializer]? Check the corresponding BeanPostProcessor declaration and its dependencies.

How to get rid of the warnings?

Additional information

EndpointConfig.java looks like:

package com.pablopaul.integrationtests;

import org.citrusframework.kafka.endpoint.KafkaEndpoint;
import org.citrusframework.kafka.endpoint.KafkaEndpointBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import java.util.HashMap;

@Configuration
public class EndpointConfig {
    @Autowired
    Environment env;

    @Bean
    public KafkaEndpoint kafkaEndpoint() {

        String keyvaultUri = env.getProperty("keyvault.uri");
        AzureKeyVault keyVaultClient = new AzureKeyVault(keyvaultUri);

        String apiKey = keyVaultClient.getSecret("api-key");
        String apiSecret = keyVaultClient.getSecret("api-secret");

        HashMap<String, Object> endpointProps = new HashMap<>();
        endpointProps.put("security.protocol", "SASL_SSL");
        endpointProps.put("ssl.endpoint.identification.algorithm", "https");
        endpointProps.put("sasl.mechanism", "PLAIN");

        endpointProps.put("sasl.jaas.config",
            "org.apache.kafka.common.security.plain.PlainLoginModule required username='" + apiKey + "' password='" + apiSecret + "';");

        return new KafkaEndpointBuilder()
            .server(env.getProperty("kafka.broker.uri"))
            .producerProperties(endpointProps)
            .consumerProperties(endpointProps)
            .topic(env.getProperty("kafka.topic"))
            .build();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants