JMS and WebService application scenario

WebService: request–>respons

Features: one-to-one, synchronous mode, after the request starts, wait until the service response returns

JMS: 1.Queue one-to-one

1. Topic one-to-many

Features: asynchronous mode, message The queue communicates with both ends separately, the producer sends a message to the end of the message queue, and the consumer obtains the message

Queue mode, a message can only be obtained by one consumer, and it becomes invalid after it is obtained

Topic mode, a message is broadcast to all consumers

Application scenarios

WebService The structure is simple, the application is more, and the synchronous mode responds quickly. But the disadvantage is that the server takes a long time to process and the client waits all the time, which wastes link resources.

Examples: query, call bill query, points query, etc.

Upload, SMS backup, QQ chat history backup, etc.

JMS implements a set of asynchronous solutions, liberating the producer and eliminating the mutual waiting between the producer and the consumer.

Example: One-to-one delivery, consumers spend longer processing time, batch storage, online banking transaction receipts, etc. Compare Webservice measurement options.

One-to-many delivery type, incremental real-time delivery of the list to multiple subsystems, must be selected.

Leave a Comment

Your email address will not be published.