jms 教程

Nowadays, most of the enterprise applications are using messaging concept for asynchronous communication between heterogeneous applications using JMS or AMQP. I’m going to deliver a series of posts to discuss these concepts in detail with real-time examples in my coming posts.

如今,大多数企业应用程序都使用消息传递概念在使用JMS或AMQP的异构应用程序之间进行异步通信。 我将在以后的文章中提供一系列文章,以实时示例的形式详细讨论这些概念。

JMS (JMS)

  • JMS is the acronym for Java Messaging System.JMS是Java Messaging System的首字母缩写。
  • JMS is part of Java EE.JMS是Java EE的一部分。
  • JMS API is the implementation to handle the producer-consumer problem.JMS API是处理生产者-消费者问题的实现。
  • JMS API allows us to create, send, receive, and read messages.JMS API允许我们创建,发送,接收和阅读消息。
  • Some o the benefits of using JMS are – loosely coupled application, reliability, and asynchronous communication.使用JMS的一些好处是–松散耦合的应用程序,可靠性和异步通信。

什么是讯息? (What is Message?)

The message is a piece of information. It can be a text, XML document, JSON data or an Entity (Java Object) etc. The message is very useful data to communicate between different systems.

该消息是一条信息。 它可以是文本,XML文档,JSON数据或实体(Java对象)等。消息对于在不同系统之间进行通信非常有用的数据。

什么是消息传递? (What is Messaging?)

Messaging means exchanging information between different components in the same system or different systems. It can happen in either a synchronous manner or an asynchronous manner.

消息传递是指在同一系统或不同系统中的不同组件之间交换信息。 它可以以同步方式或异步方式发生。

什么是JMS? (What is JMS?)

JMS stands for Java Message Service. JMS API is a Java API which contains a common set of interfaces to implement enterprise based messaging systems. JMS API is used to implement Messaging systems in Java-based applications only, it does not support other languages.

JMS代表Java消息服务。 JMS API是Java API,其中包含一组通用接口,以实现基于企业的消息传递系统。 JMS API仅用于在基于Java的应用程序中实现消息系统,它不支持其他语言。

JMS API is used to create, send, receive and read messages or exchange messages between different systems. Once we develop a Java Messaging System with JMS API, then we can deploy the same application in any JMS Provider software.

JMS API用于在不同系统之间创建,发送,接收和读取消息或交换消息。 一旦我们使用JMS API开发了Java消息系统,就可以在任何JMS Provider软件中部署相同的应用程序。

JMS Architecture

JMS体系结构

An Enterprise Application may have ‘n’ number of components and they are exchanging messages by using one of the Messaging System as shown below.

企业应用程序可能具有“ n”个组件,并且它们正在使用消息系统之一来交换消息,如下所示。

JMS Messaging System

JMS消息系统

Some Enterprise applications may have ‘n’ number systems and they exist in different locations. They use different platforms. If they want to exchange information in a loosely coupled manner, then we should use JMS Messaging system.

某些企业应用程序可能具有n个编号系统,并且它们存在于不同的位置。 他们使用不同的平台。 如果他们想以松散耦合的方式交换信息,那么我们应该使用JMS Messaging系统。

JMS in Distributed Systems

分布式系统中的JMS

JMS的优势 (JMS Advantages)

  • Loosely Coupled: We can develop loosely coupled applications very easily. That means JMS API is standard or specification that should be implemented by all JMS Providers so that we can change existing JMS Provider to new JMS Provider with little changes (that means only configurations) or without changing our JMS Application code.松耦合 :我们可以很容易地开发松耦合应用程序。 这意味着JMS API是所有JMS提供程序都应实施的标准或规范,以便我们可以将现有的JMS提供程序更改为新的JMS提供程序,而只需进行很少的更改(即仅配置),而无需更改我们的JMS应用程序代码。
  • Asynchronous: We can develop asynchronous messaging applications very easily. That means JMS Sender can send messages and continue on its own work. It does not wait for the completion of message consumption by JMS Receiver.异步 :我们可以非常轻松地开发异步消息应用程序。 这意味着JMS Sender可以发送消息并继续自己的工作。 它不等待JMS Receiver完成消息使用。
  • Robust and Reliable: JMS ensures that a message is delivered one and only once to the destination system. So we can develop reliable applications very easily.健壮且可靠 :JMS确保将一条消息仅传递到目标系统一次。 因此,我们可以非常轻松地开发可靠的应用程序。
  • Interoperability: JMS API allows Interoperability between other Java Platform languages like Scala and Groovy.互操作性 :JMS API允许其他Java平台语言(例如Scala和Groovy)之间的互操作性。

JMS组件 (JMS Components)

A typical JMS system contains the following components:

典型的JMS系统包含以下组件:

  1. JMS Client: Java program used to send (or produce or publish) or receive (or consume or subscribe) messages.JMS客户端 :用于发送(或产生或发布)或接收(或使用或订阅)消息的Java程序。
  • JMS Sender: JMS Client which is used to send messages to the destination system. JMS sender is also known as JMS Producer or JMS Publisher.JMS Sender :用于将消息发送到目标系统的JMS客户端。 JMS发送者也称为JMS生产者或JMS发布者。
  • JMS Receiver: JMS Client which is used to receive messages from Source system. JMS Receiver is also known as JMS Consumer or JMS Subscriber.JMS接收器 :JMS客户端,用于从源系统接收消息。 JMS接收器也称为JMS使用者或JMS订阅者。
  • JMS Provider: JMS API is a set of common interfaces, which does not contain any implementation. JMS Provider is a third-party system who is responsible to implement the JMS API to provide messaging features to the clients.

    JMS Provider is also known as MOM (Message Oriented Middleware) software or Message Broker or JMS Server or Messaging Server. JMS Provider also provides some UI components to administrate and control this MOM software.

    JMS Provider :JMS API是一组通用接口,不包含任何实现。 JMS Provider是第三方系统,负责实施JMS API以向客户端提供消息传递功能。

    JMS Provider也称为MOM(面向消息的中间件)软件或Message Broker或JMS Server或Messaging Server。 JMS Provider还提供了一些UI组件来管理和控制此MOM软件。

  • JMS Administered Objects: JMS Objects which are preconfigured by an administrator for the use of JMS clients. They are ConnectionFactory and Destination Objects.JMS管理对象 :管理员为使用JMS客户端而预先配置的JMS对象。 它们是ConnectionFactory和目标对象。
    • ConnectionFactory: ConnectionFactory object is used to create a connection between Java Application and JMS Provider. It is used by Application to communicate with JMS Provider.ConnectionFactory :ConnectionFactory对象用于在Java应用程序和JMS Provider之间创建连接。 应用程序使用它与JMS Provider进行通信。
    • Destination: Destinations are also JMS Objects used by a JMS Client to specify the destination of messages it is sending and the source of messages it receives. There are two types of Destinations: Queue and Topic.目标 :目标也是JMS客户端使用的JMS对象,用于指定其发送的消息的目的地和接收的消息的源。 有两种类型的目标:队列和主题。
  • JMS Message: an object that contains the data being transferred between JMS clients.JMS消息 :一个对象,其中包含在JMS客户端之间传输的数据。
  • 最受欢迎的JMS提供者 (Most popular JMS Providers)

    S.No. JMS Provider Software Organization
    1. WebSphere MQ IBM
    2. Weblogic Messaging Oracle Corporation
    3. Active MQ Apache Foundation
    4. Rabbit MQ Rabbit Technologies(acquired by Spring Source)
    5. HornetQ JBoss
    6. Sonic MQ Progress Software
    7. TIBCO EMS TIBCO
    8. Open MQ Oracle Corporation
    9. SonicMQ Aurea Software
    序号 JMS Provider软件 组织
    1。 WebSphere MQ IBM公司
    2。 Weblogic消息传递 Oracle公司
    3。 主动MQ 阿帕奇基金会
    4。 兔子MQ Rabbit Technologies(由Spring Source收购)
    5, 大黄蜂 老板
    6。 音速MQ 进度软件
    7 TIBCO EMS 泰科
    8。 打开MQ Oracle公司
    9。 SonicMQ Aurea软件

    JMS API的历史 (History of JMS API)

    S.No. JMS API Version Released Date
    1. JMS 1.0.2 June 2001
    2. JMS 1.1 March 2003
    3. JMS 2.0 May 2013
    序号 JMS API版本 发布日期
    1。 JMS 1.0.2 2001年6月
    2。 JMS 1.1 2003年3月
    3。 JMS 2.0 2013年5月

    结论 (Conclusion)

    JMS API is a robust way to implement a messaging system in our applications. There are various popular JMS providers including AMQP from Spring framework.

    JMS API是在我们的应用程序中实现消息传递系统的可靠方法。 有许多流行的JMS提供程序,包括Spring框架的AMQP。

    Reference: Wikipedia Article

    参考: 维基百科文章

    翻译自: https://www.journaldev.com/9731/jms-tutorial

    jms 教程

jms 教程_JMS教程–什么是JMS相关推荐

  1. java jms例子_JMS 教程 学习笔记 (九)JMS 样例代码

    本章给出了一些展示JMS 客户端如何使用JMS API 的代码样例.也解释了如何使用几个消息类型.这些例子使用了支持统一消息模型的方法:这些例子使用点对点或发布/订阅进行工作.用JMS API 进行工 ...

  2. [z]JMS简明学习教程

    基础篇 JMS是应用系统或组件之间相互通信的应用程序接口,利用它,我们可以轻易实现在不同JVM之间相互的远程通信.要实现远程通信,RPC同样也能做到,但RPC却不可避免地增加了不同系统之间的耦合度,J ...

  3. (转)JMS简明学习教程

    转:http://www.cnblogs.com/jjj250/archive/2012/08/08/2628552.html 基础篇 JMS是应用系统或组件之间相互通信的应用程序接口,利用它,我们可 ...

  4. jms架构_JMS架构和JMS API架构

    jms架构 Before reading this post, please go through my previous at "JMS Administered Objects and ...

  5. java jms框架_JMS (Java Message Service)

    19.1. 简介 Spring提供了一个用于简化JMS API使用的抽象框架,并且对用户屏蔽了JMS API中1.0.2和1.1版本的差异. JMS的功能大致上分为两块,叫做消息制造和消息消耗.Jms ...

  6. ASP.NET Core 异常和错误处理 - ASP.NET Core 基础教程 - 简单教程,简单编程

    原文:ASP.NET Core 异常和错误处理 - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 异常和错误处理 上一章节中,我们学习了 ASP.NET Cor ...

  7. python菜鸟教程字典-python教程菜鸟教程学习路线

    python教程菜鸟教程学习路线,需要学Python 环境搭建.Python 中文编码.Python 基础语法.Python 变量类型.Python 运算符.Python 条件语句.Python 循环 ...

  8. ASP.NET Core macOS 环境配置 - ASP.NET Core 基础教程 - 简单教程,简单编程

    ASP.NET Core macOS 环境配置 - ASP.NET Core 基础教程 - 简单教程,简单编程 原文:ASP.NET Core macOS 环境配置 - ASP.NET Core 基础 ...

  9. ASP.NET Core Razor 标签助手 - ASP.NET Core 基础教程 - 简单教程,简单编程

    原文:ASP.NET Core Razor 标签助手 - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core Razor 标签助手 上一章节我们介绍了视图导入,学习了 ...

最新文章

  1. Xamarin XAML语言教程基本视图ContentView
  2. 0066-若干个数求和问题
  3. WEB前端 前端开发者 如何突破技术瓶颈
  4. php函数从数组中取出指定的数目,PHP数组函数
  5. python中idle怎么打开_为什么我的python脚本只打开IDLE?
  6. c++ windows 蓝牙库_蓝牙翻页笔(PPT 控制器) | ESP32学习之旅-Arduino版
  7. Word2010-页眉中字数未满但自动换行
  8. 特征值分解、奇异值分解、PCA概念整理(转载)
  9. 山寨一个PetShop(Task002)——数据类库Model
  10. Python使用pandas合并多个Excel文件
  11. encodeURIcomponent编码和ASP.NET之间编码转换
  12. 【直通BAT】剑指Offer 经典试题整理(5)
  13. php number_format 通过千位分组来格式化数字
  14. Android单元测试Junit的配置
  15. python将一个word文档中内容全部复制,添加到另一个word文档末
  16. c语言数列求和程序137,C语言循环结构 -C语言数列求和(使用while循环)
  17. 改变this指向的方法
  18. 6-3 在一个数组中实现两个堆栈 (22分)
  19. 软路由Linux7,CentOS 7 NAT软路由
  20. 时间序列频繁模式挖掘:GSP算法、SPADE算法

热门文章

  1. iOS开发-使用Storyboard进行界面跳转及传值
  2. [转载] Python ascii()函数
  3. [转载] python异常和错误有什么区别_python的错误和异常
  4. [转载] python中numpy.concatenate()函数的使用
  5. FPGA开发设计必经之路:时序分析
  6. python 全栈开发,Day81(博客系统个人主页,文章详情页)
  7. 接口测试系列:工作中所用(十:配置文件的读写操作 configparser模块)
  8. 第四章 jQuery文档处理
  9. pytorch---之随机种子初始化
  10. 数据结构上机实践第七周项目2 - 自建算法库——链队(链式队列)