简体   繁体   中英

EJB Java: Better to use Session beans or message driven beans

I would like to design a web based application. Required functionality includes sending messages from my system to the remote system. In addition, my EJB system will also respond to messages from the remote system.

Which type of enterprise beans should I use? Should I use stateless session beans, message driven bean, or both?

As you might be know that MDB is asynchronous and as per my concerns chat application must a asynchronous as why CLIENT should wait for your response. And if your application gets millions of request for the message then stateless session will not help in the performance so its better to use MDB. Revert me in case of any concern.

Message driven beans are ideal for external integrations whereby the connection between two machines may be interrupted for periods of time. By using messages instead of relying on 100% uptime with server-server connections, failure modes can be embraced as a part of the process instead of fought against with workarounds and special cases.

While messages can induce latency, they can actually have higher throughput due when combined with queueing systems such as ActiveMQ.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM