开发者

What is the difference between NIO and JMS

开发者 https://www.devze.com 2023-02-11 21:54 出处:网络
As I understand Java NIO is an API to help create event-driven applications. Where you use a selector to notify your application of any data received over a SocketChannel.

As I understand Java NIO is an API to help create event-driven applications. Where you use a selector to notify your application of any data received over a SocketChannel. JMS(Java Messaging Service) is a messaging framework for sending/receiving messages between clients.

Is J开发者_高级运维MS a abstraction of Java NIO API?


NIO just stands for New IO. It's an enhanced general Java IO package, that has a lot of support for asynchronous IO, but also contains quite a few other enhancements, like support for grepping through filenames. You would use it when you're trying to do something that's not supported by the classes in java.io.

JMS is a java messaging system. You can use it when you need to have two applications talk to one another over a queue-like system. Whether or not it uses NIO under the hoods is an implementation detail, though various JMS providers written in Java probably do.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号