Search code examples
javalotus-noteslotus-dominojavaagents

Create Java Agent vs Calling Notes API - Louts Notes


I have a task of reading emails from Lotus Dominos mailbox. To perform the same I am have following two options (there might be other options as well):

  1. Create a Java Agent within the mailbox and schedule it. It will process the mails and take actions.\
  2. Write separate Java code with used Notes API and call dominos server to fetch mails and process them.

What is difference in both? Capabilities or something else?


Solution

  • Write a Java Agent to run inside the email server

    Pros

    1. Lets you leverage all of the resiliency of the email server itself
    2. Can be reasonably guaranteed to start and stop with the email server
    3. Less code to manage
    4. Easier to keep error logging with email server

    Cons

    1. Vendor specific so it will be less portable

    Reason for personal opinion

    I wrote a client that used IMAP to read emails inside an inbox periodically and I set up a James Mail Server with something like the agent you are talking about to programmatically respond to emails that were received by an email address. I tend to like your option 1 (a Java agent running inside the email server) because it lets you leverage all of the resiliency of the email server itself. The code can be reasonably guaranteed to start and stop with the email server and it's logging is connected to the logging of the server. Making a stand alone agent has the benefit of working with servers other than your initial configuration (especially if you leverage standard protocols). But you have to do more to make sure it is operational and you have to work harder to debug (in my own experience). Also, the Java Agent approach tends to be smaller so there is less code to manage.