When is messaging (e.g. JMS) an alternative for multithreading?

前端 未结 6 2145
北恋
北恋 2021-01-05 15:13

I work on a data processing application in which concurrency is achieved by putting several units of work on a message queue that multiple instances of a message driven bean

6条回答
  •  青春惊慌失措
    2021-01-05 15:22

    Messaging can reduce number of errors in multithreaded applications greatly, since it reduces risk of data races. It also simplifies adding new threads without changing the rest of app.

    Although I think JMS is slightly misused here. java.util.concurrent's thread-safe queues and libraries like jetlang may provide you better performance.

提交回复
热议问题