I'm trying to receive emails with a message-driven bean. I'm using jboss wildfly. Unfortunatley, I can't find a real documentation on it. This is the most I've found so far:
@MessageDriven(activationConfig={
@ActivationConfigProperty(propertyName="mailServer", propertyValue="imap.gmail.com"),
@ActivationConfigProperty(propertyName="mailFolder", propertyValue="INBOX"),
@ActivationConfigProperty(propertyName="storeProtocol", propertyValue="imap"),
@ActivationConfigProperty(propertyName="userName", propertyValue="me@gmail.com"),
@ActivationConfigProperty(propertyName="password", propertyValue="xxx")
})
@ResourceAdapter("mail-ra.rar")
public class EMailReceiver implements MailListener {
@Override
public void onMessage(Message msg) {
System.out.println("MSG: " + msg.toString());
}
}
I have several questions on how to make this work. Sorry for putting them all into one question, but I believe they belong together.
- what is this ResourceAdapter? I can find a ResourceAdapter class, but not an annotation.
- where do I get the correct mail-ra.rar and where do I put it ? I asssume this might come in different versions and I can't find one inside wildfly.
- is the annotation config sufficient or do I need to configure anything in xml?