Is there any relationship between javax.jms.Message and javax.mail.Message?
Created May 4, 2012
Rajiv Kanaujia
There is no direct relationship between javax.mail.Message and javax.jms.Message. If your requirement is to map (correlate) them, here is what you can do:
- From JMS domain to JavaMail domain (a javax.jms.Message is received):
- A JMS topic/queue can be associated with one or many e-mail id(s).
- The JMS Message Header can be mapped to custom JavaMail Message Header.
- The JMS Message Body can be associated with the JavaMail Message body.
- A JavaMail client application should be able to process these custom headers and the content of the message body.
- From JavaMail domain to JMS domain (a javax.mail.Message is received):
- An e-mail id can be associated with one or more JMS topics/queues.
- The JavaMail Message Header can be mapped to custom JMS Message Header.
- The JavaMail Message Body can be associated with the JMS Message body.
- The JMS client application should be able to process these custom headers and the content of the message body.
In a simple application that I tried, I removed the custom header scenario and just forwarded the contents of the message (text message), which worked without any problems.
Try using SonicMQ bridges, which already has something like that.