Dependency injection from inside custom Automatic Indexing Strategy

Hi Team,

I am using hibernate search 6.0 CR1 along with spring boot; using spring for bean injection; is their any way to autowired a bean from inside class implementing AutomaticIndexingSynchronizationStrategy

please see the following snapshot code which used for custom automatic indexing strategy; plus i am defining it inside yml file as following
hibernate.search.automatic_indexing.synchronization.strategy: com…MyWriteSyncAutomaticIndexingSynchronizationStrategy

public class MyWriteSyncAutomaticIndexingSynchronizationStrategy
implements AutomaticIndexingSynchronizationStrategy {

public static final MyWriteSyncAutomaticIndexingSynchronizationStrategy INSTANCE = new MyWriteSyncAutomaticIndexingSynchronizationStrategy();
private static final Log log = LoggerFactory.make(Log.class, MethodHandles.lookup());
@Autowired
HazelcastInstance hazelcastInstance;

public MyWriteSyncAutomaticIndexingSynchronizationStrategy() {
}

@Override
public void apply(AutomaticIndexingSynchronizationConfigurationContext context) {
    context.documentCommitStrategy(DocumentCommitStrategy.FORCE);
    context.documentRefreshStrategy(DocumentRefreshStrategy.NONE);
    FailureHandler failureHandler = context.failureHandler();
    context.indexingFutureHandler(future -> {
        SearchIndexingPlanExecutionReport report = future.join();
        report.throwable().ifPresent(t -> {
            EntityIndexingFailureContext.Builder contextBuilder = EntityIndexingFailureContext.builder();

            for (EntityReference entityReference : report.failingEntities()) {
                contextBuilder.entityReference(entityReference);
                hazelcastInstance.getMap("someMap").put(entityReference.id(),entityReference);
            }
            throw log.indexingFailure(t.getMessage(), report.failingEntities(), t);
        });
    });
}

}

Any help highly appreciated.

Autowiring should work by default as long as Spring is able to retrieve your strategy as a bean. Did you register your strategy as a bean in the Spring context? With Spring Boot, you would need to enable component scanning for the package you put your strategy in, and annotate the strategy with @Component.