简体   繁体   中英

Multithreading in JMS

I need to write a multithreaded JMS producer, and a multithreaded JMS consumer; I am relatively new to working with JMS and I have never had to multithread before. I see in the API that you can send and receive messages asynchronously using a Completion Listener for the producer and a Message Listener for the consumer. Does this mean that using a completion listener and a message listener causes the program to be multithreaded? If not how do you go about writing a multithreaded producer and a multithreaded consumer?

Avoid Multi-threading The JMS Specification states that multi-threading a session, producer, consumer, or message method results in undefined behavior except when calling close(). For this release, if WebLogic JMS determines that you created a multi-threaded producer, the server instance throws a JMSException. If your application is thread limited, try increasing the number of producers and sessions.

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