Skip to content

Autowiring a GemfireTemplate into the application is not working in all cases #55

@kohlmu-pivotal

Description

@kohlmu-pivotal

Autowiring the {{o.s.d.g.GemfireTemplate}} as per the documentation does not work as documented.

Seems it has to do with the lazy initialization of the Region. If the Repository is annotated wit DependsOn("Customers"), then the problem is resolved.

@Repository
public class DemoRepository {

	@Autowired
	@Qualifier("customersTemplate")
	private GemfireTemplate customersTemplate;

	public void putData(String key, String value) {
		customersTemplate.put(key, value);
	}
}

Fails with:

Description:

Field customersTemplate in com.example.demo.client.repo.DemoRepository required a bean of type 'org.springframework.data.gemfire.GemfireTemplate' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.data.gemfire.GemfireTemplate' in your configuration.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions