Skip to content

ImapMailReceiver bean is not initialized #2995

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

Closed
garyrussell opened this issue Jul 22, 2019 · 2 comments
Closed

ImapMailReceiver bean is not initialized #2995

garyrussell opened this issue Jul 22, 2019 · 2 comments
Labels
status: invalid Not reproducable or not relevant to the current state of the project

Comments

@garyrussell
Copy link
Contributor

See https://stackoverflow.com/questions/57126841/how-to-enable-imapfolder-read-write-mode-in-spring-mail-integration/57146996#57146996

		return IntegrationFlows
				.from(Mail.imapInboundAdapter("imaps://usr:[email protected]/INBOX")
						.searchTermStrategy(searchTermStrategy).shouldMarkMessagesAsRead(true).get(),
						e -> e.poller(Pollers.fixedRate(5000).maxMessagesPerPoll(1)))
				.log()
				.get();

No call to afterPropertiesSet() is made.

@garyrussell garyrussell added this to the 5.1.7 milestone Jul 22, 2019
@artembilan
Copy link
Member

artembilan commented Jul 22, 2019

You should not call .get() on the IntegrationComponentSpec when you use it this way via DSL.
After that get() we don't have any clues in the Framework how you declared that component. Therefore we don't have any permissions to call afterPropertiesSet() for you.
When it is left without get() the Framework takes care about proper bean initialization.

Not sure if we have such a note in docs, but I treat this as end-user error and close as Works as Designed.

@artembilan artembilan added status: invalid Not reproducable or not relevant to the current state of the project and removed type: bug labels Jul 22, 2019
@garyrussell
Copy link
Contributor Author

Doh; sorry; missed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid Not reproducable or not relevant to the current state of the project
Projects
None yet
Development

No branches or pull requests

2 participants