Search Results

Search found 2 results on 1 pages for 'jezhilvalan'.

Page 1/1 | 1 

  • passing java mail message object from between applications

    - by jezhilvalan
    I'm using java mail api 1.4.1 to obtain new emails. Two classes are being used to obtain emails and then parsing it. "GetMail" class communicates with mail server(Gmail,yahoo etc) and obtains the message object. Then the message object is passed to yet another class "MailFormatter" class, which then parses the message object, obtains the email headers (From,To,Subject etc) and then it parses the Multipart content to obtain the main body and attachments.Since both "Mail getting" and "Mail formatting" process are very resource intensive, these classes are going to be implemented as separate web applications.This application is going to monitor new emails for numerous email ids.If these ("GetMail" and "MailFormatter") are implemented as separate web applications, how can I pass the message object from "GetMail" app to "MailFormatter" app ? Is there a way through which I can persist the obtained message object in a certain location (a location which is common to both "GetMail" and "MailFormatter" applications), so that "GetMail" can persist the message object in that location, and then "MailFormatter" app can read "Message" objects from that location and carry out the parsing process. Message objects cannot be serialized. If they cannot be serialized how can I persist the state of java mail message object? please do help me to resolve this issue.

    Read the article

  • sharing message object between web applications

    - by jezhilvalan
    I need to share java mail message objects between two web applications(A and B). WebApplication A obtains the message and write it to the outputStream for(int i=0;i<messagesArr.length;i++){ uid = pop3FolderObj.getUID(messagesArr[i]); //storing messages with uid names inorder to maintain uniqueness File f = new File("F:/PersistedMessagesFolder" + uid); FileOutputStream fos = new FileOutputStream(f); messagesArr[i].writeTo(fos); fos.flush(); fos.close(); } Is FileOutputStream the best output stream for persisting message objects? Is it possible to use ObjectOutputStream for message object persistence? WebApplication B reads the message object via InputStream FileInputStream fis = new FileInputStream("F:/MessagesPersistedFolder"+uid); MimeMessage mm = new MimeMessage(sessionObj,fis); What if the mail message object which is already written via WebApplication A is not a MimeMessage? How can I read non-mime messages using input stream? MimeMessage constructor mandates sessionObj as the first parameter? How can I obtain this sessionObj in WebApplicationB? Do I have to again establish store connection with the same emailid,emailpassword,popserver and port(already used in WebApplication A) with the email server inorder to obtain this session object? Even if obtained, will this session object remains the same as that of the session object which is priorly obtained in WebApplicationA? Since I am using uids to name Message objects (inorder to maintain uniqueness of file names) how can I share these uids between WebApplication A and WebApplication B? WebApplication B needs the uid inorder to access the specific file which is present in "F:/MessagesPersistedFolder" Please help me in resolving the aforeseen issues.

    Read the article

1