`

mule studio 建立apachemq 路由

    博客分类:
  • mule
阅读更多

Mule Studio offers easy-to-use components to connect to JMS Queues and Topics. In today’s example, we’re going to learn how to use ActiveMQ, a leading open source JMS implementation from Apache that supports JMS 1.1 specification.

Here’s an outline of the simple steps required to implement this example:

  • Import ActiveMQ libraries
  • Create an ActiveMQ connector
  • Enqueue to JMS Queue
  • Run the sample

 

1. Import ActiveMQ Library

Download ActiveMQ binaries from http://activemq.apache.org/download.html. In this example, I am using the ActiveMQ 5.4.3 release. Unzip the compressed file to any folder on your file system. Let’s call it <ACTIVEMQ_HOME>.

Create a new flow in Mule Studio and name it “jms”. To configure the project to use ActiveMQ libraries, right-click on the project -> Properties -> Java Build Path -> Add External JARs. Select “activemq-all-5.4.3.jar” from <ACTIVEMQ_HOME>.

active-mq

We can see that the ActiveMQ library is now available under Build path.
activemq-libraries

2. Create an ActiveMQ Connector

Double-click on “jms” flow to bring up the message flow. Click on the “Global Elements” tab. Click on “Create” and locate ActiveMQ under “Connectors -> JMS”. Leave the default values for the Active_MQ connector and click OK.

activemq-connector

Mule will initialize the ActiveMQ connector with a default instance of the ActiveMQ connection factory and establish a TCP connection to the remote standalone broker running on a local host and listening on port 61616.

3. Enqueue to JMS Queue

We will use the request payload received from an HTTP inbound endpoint to seed the ActiveMQ Queue. Open the “jms” message flow and drag and drop an HTTP endpoint on to the flow.

Double-click on the HTTP endpoint to bring up the properties dialog. Specify “jms” for Path. This will make the HTTP endpoint accessible using URL  http://localhost:8081/jms .

activemq-http

Drag and drop a JMS endpoint next to the HTTP inbound endpoint.

Double-click the JMS endpoint to bring up the properties dialog. Specify “StudioIN” for Queue name. This dialog also allows specifying properties for transactions and exchange patterns. We will explore these concepts in future lessons.

activemq-jms-1

Click on the References tab and select “Active_MQ” for Connection Reference. We created the “Active_MQ” connector in Step 2.

activemq-jms-2

Click OK to save these properties and return to JMS Message Flow.

activemq-flow_0

We are now ready to run this sample.

4. Run the sample

First, run ActiveMQ using executable “activemq” from <ACTIVEMQ_HOME>/bin folder. Make sure you can access the ActiveMQ admin page using http://localhost:8161/ .

activemq-admin

In Mule Studio, right-click on “jms” and select “Run as Mule Flow”.

Open http://localhost:8081/jms . This will enqueue the request to the ActiveMQ JMS Queue “StudioIN”.

Verify this by examining the ActiveMQ administration page at http://localhost:8161/admin/queues.jsp . We can see that there is 1 message under the “Messages Enqueued” column.

activemq-seeded

More details on ActiveMQ integration can be found in the Mule 3 User Guide .

Related posts:

  1. Mule School: Hello World
  2. Mule School: Invoking Java Component over HTTP
  3. Mule School: Using Flow Controls – Choice Router
  4. Getting started with Mule: Free Training, Videos, Tutorials

更多实例 http://blogs.mulesoft.org/category/mule-studio/

分享到:
评论

相关推荐

    MuleStudio

    **MuleStudio** 是一款由MuleSoft公司开发的集成开发环境(IDE),专门用于构建、测试和部署基于Mule ESB(企业服务总线)的企业级应用。Mule ESB是一个开源的服务导向架构(SOA)平台,它允许不同系统和应用程序...

    MuleStudio用户手册

    **MuleSoft MuleStudio 用户手册** MuleStudio是一款由MuleSoft公司开发的强大集成工具,主要用于构建、测试和部署企业级的集成解决方案。这款工具是基于Eclipse平台的,支持Mule ESB(Enterprise Service Bus)的...

    MuleStudio用户手册.doc

    ### MuleStudio用户手册知识点概览 #### 一、Mule 概述 - **核心特点**:Mule 是一款以 Java 为核心的基础框架及整合平台,它支持超过30种传输协议,如 FTP、HTTP、SOAP 等,并且能够与 Spring、ActiveMQ 等流行...

    MuleStudio334,MuleStudio-CE-for-win-32bit-1.3.1-201209041400.zip

    《MuleStudio 3.3.4:集成开发环境的深度解析》 MuleSoft的MuleStudio是一款专为构建企业级集成解决方案而设计的强大工具,尤其在版本号为3.3.4时,它已经成为了许多开发人员的首选。这款软件的核心在于其对Mule ...

    MuleStudio 开发手册

    MuleStudio是MuleSoft公司开发的一个集成开发环境(IDE),主要面向基于Mule ESB(企业服务总线)的应用集成开发。Mule ESB是MuleSoft推出的一款轻量级、开源的企业服务总线产品,用于帮助企业或组织快速实现应用...

    MuleStudio335

    MuleStudio 335 是一个专为集成和开发企业应用程序而设计的集成开发环境(IDE),主要用于构建基于Mule ESB(企业服务总线)的应用。Mule ESB 是一款开源的服务集成平台,它允许开发者连接不同的系统、应用和服务,...

    MuleStudio446

    【MuleStudio 446】是MuleSoft公司开发的一款集成开发环境(IDE),专用于构建和测试基于Mule ESB(企业服务总线)的集成解决方案。Mule ESB是一个开源的企业级中间件,它允许不同系统、应用程序和服务之间进行数据...

    Mule ESB Studio v3.3 安装使用手册

    【Mule ESB Studio v3.3 安装使用手册】是针对Mule ESB集成服务平台的一个详细指导,旨在帮助用户成功安装和使用Mule Studio。Mule ESB是一款强大的企业服务总线(ESB)工具,用于构建、部署和管理集成解决方案。...

    muleStudio444

    1. **Mule Runtime**: Mule Runtime是Mule ESB的核心,它处理消息的路由、转换和安全。在Mule Studio中,开发者可以创建基于Mule Runtime的应用程序。 2. **Anypoint Design Center**: 这是Anypoint Platform的一...

    Mule 实现路由分发

    Mule Studio(现在称为Anypoint Studio)提供了丰富的工具,如断点、日志记录和模拟输入,帮助开发者调试和验证路由逻辑。 10. **Mule运行时环境**: 最后,所有这些功能都需要在Mule运行时环境中执行。Mule运行时是...

    mulestudiod

    【MuleStudio】是一款强大的集成开发环境(IDE),专门用于构建和管理基于Mule ESB(企业服务总线)的应用程序。Mule ESB是一种开源的企业级应用集成平台,它允许开发者连接各种不同的系统、应用和服务,实现数据的...

    Mule ESB Studio安装使用手册

    ### Mule ESB Studio安装使用手册 #### 一、初级教程概述 Mule ESB Studio是一款功能强大的集成开发工具,用于构建基于Mule ESB(Enterprise Service Bus)的应用程序和服务。Mule ESB是一个广泛应用于企业级应用...

    Mule_Studio_用户手册.pdf

    ### Mule Studio 用户手册知识点概览 #### 一、Mule Studio 概述 - **Mule Studio**:是一款基于Eclipse的集成开发环境(IDE),专为Mule ESB(企业服务总线)设计。它提供了一个直观的图形用户界面,使开发者能够...

    Mule stdio 安装过程

    总的来说,Mule ESB作为一个强大的ESB解决方案,为企业提供了高效、灵活的系统集成能力,而Mule Studio则为开发者提供了一个便捷的开发和测试环境。通过了解Mule ESB的基本概念、功能及其安装流程,开发者可以更有效...

    MuleStudio用户手册(中文版)

    MuleStudio用户手册,中文版,提供各个组件的功能及使用说明,版本有点早,仅供参考用,适合初学者快速入门。

    一步步了解ESB (二) Mule ESB-Basic Studio Tutorial

    在Mule Studio中,你可以通过配置连接器的属性来建立连接。同时,Mule还支持数据转型,允许你将输入消息转化为适合目标系统格式的消息。 ### 6. 部署与运行 完成应用设计后,Mule应用可以部署到本地Mule服务器或云...

    Mule ESB手册-中文版

    Mule Studio是基于Eclipse的集成开发环境(IDE),它为开发人员提供了一个可视化的工具来设计、开发和部署Mule ESB项目。该部分介绍了Mule Studio的基本使用方法,包括如何下载安装、创建项目、保存项目、运行和停止...

Global site tag (gtag.js) - Google Analytics