17) JMS: java Message Service (Java Message Service), jmsmessage
JMS is a standard, just like EJB, which has many open-source and commercial implementations. The specification corresponding to ms technology is jsr914. The implementation of the Specification is called jms provider, common implementations include ActiveMQ, JBoss MQ, and IBM Websphere MQ. Its main advantages: (1) two systems or modules can be loosely coupled. Module A does not need to directly call Module B, but only needs to send A message in the agreed format to the jms provider, module B receives the message and carries out subsequent business processing (2) the jms method is asynchronous, meaning that after module A sends the message, it does not need to wait for the response from Module B or jms provider, the business logic of the client can continue to be the sender or receiver. The sending information follows the steps below: (1) Use the JNDI to query the JMS ConnectionFactory and Destination (JMS Queue/Topic) objects)
(2) Use the management object JMS ConnectionFactory to establish a Connection (initialize the environment)
(3) Use Connection to establish a Session (initialize the environment)
(4) use the Session and management object Destination to create MessageSender/MessageReceiver for the message producer. (A Session for a queuename is created until this step. The previous Connection and Session are initialized in the whole JMS environment)
(5) Send/receive messages