Spring integration imap - multiple email accounts from the same domain -


i'm using spring's imap mechanism in order recieve emails account server.

this works charm.

anyhow, new requirmemnt came - instead of listening single email account have listen on multiple number of accounts.

iv'e tried creating new channel each of these account. works!

problem each channel added meaning new thread running.
since i'm talking large number of accounts quiet issue.

my question is:

since email accounts (i listen to) in same domain i.e: acount1@mydomain.com acount2@mydomain.com acount3@mydomain.com ....

is possible create single channel multiple accounts?

is there alternative me defining n new channels?

thanks. nir

i assume mean channel adapter, not channel (multiple channel adapters can send messages same channel).

no, can't use single connection multiple accounts.

this limitation of underlying internet mail protocols.

if using imap idle adapters, yes, not scale because needs thread each. however, if talking few 10s of accounts, not issue. larger number of accounts, may better use polled adapter.

but, so, unless it's fixed number of accounts, configuration burdensome (but programmatically spin new adapters).

for complex scenarios this, may want consider writing own "adapter" uses javamail api directly , manages connections in more sophisticated way (but still need separate connection each account). wouldn't have "real" adapter, pojo interracts javamail. then, when receive message 1 of accounts, send channel using <gateway/>.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -