Operating System - OpenVMS
1757032 Members
2401 Online
108858 Solutions
New Discussion юеВ

Messages exchange between java threads

 
SOLVED
Go to solution
Fedele Giuseppe
Frequent Advisor

Messages exchange between java threads

Hello,

I need to implement a messages exchange protocol between two Java threads of the same process.

What are the pro/cons of the usage of JMS API in this particular case?

Giuseppe
2 REPLIES 2
Jonathan Cronin
Advisor
Solution

Re: Messages exchange between java threads

JMS is pretty heavy-weight for this. If you don't need persistence across crashes and you don't need asynchronous messaging then I think the most convenient way is to use java.util.concurrent.SynchronousQueue. If you do need
asynchronous, then one of the other Queue implementations
is a good choice

Jonathan
Fedele Giuseppe
Frequent Advisor

Re: Messages exchange between java threads

Ok thanks.