Git Product home page Git Product logo

external-mq-fabric-client's Introduction

NOTE: This project is not supported on JBoss Fuse version 6.3 or later

MQ-Fabric Client Example

This project shows how to connect to JBoss A-MQ message brokers running in Fuse Fabric from JMS clients running outside of Fuse Fabric (i.e. when the JMS client is not running within a Fabric-enabled Fuse ESB container).

The Getting Started with ActiveMQ project uses broker URL's like this:

failover:(tcp://host1:port1,tcp://host2:port2)

which are replaced in this project with values like this (that also handle failover):

discovery:(fabric:broker-group-name)

In addition to changing the broker URL's, two other changes are needed to support fabric discovery: a zookeeper.url System property needs to be set in the environment, and a few Fabric libraries must be added to the classpath.

Setting the zookeeper.url

On a typical developer machine, with Fuse Management Console running locally, the zookeeper.url System property should be set to the URL of the Fuse Fabric's Zookeeper instance, which defaults to localhost:2181. One can simply append the property to the startup command line like this:

-Dzookeeper.url=localhost:2181 

or add the following to the Maven profile configuration, as is done in this project.

<systemProperty>
    <key>zookeeper.url</key>
    <value>localhost:2181</value>
</systemProperty>

When a distributed Fabric Registry is used (i.e. a Zookeeper ensemble) the zookeeper.url property should be set to a comma delimited list, like this:

-Dzookeeper.url=london:2182,seattle:2181,portland:2181

Adding the Fabric libraries

These are the dependencies added to the Maven project to support the fabric discovery protocol (see the pom.xml for version info):

<dependency>
    <groupId>org.jboss.amq</groupId>
    <artifactId>mq-fabric</artifactId>
    <version>${amq.version}</version>
</dependency>
<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>fabric-groups</artifactId>
    <version>${fabric.version}</version>
</dependency>
<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>fabric-zookeeper</artifactId>
    <version>${fabric.version}</version>
</dependency>
<dependency>
    <groupId>org.osgi</groupId>
    <artifactId>org.osgi.core</artifactId>
    <version>${osgi.version}</version>
</dependency>
<dependency>
    <groupId>org.osgi</groupId>
    <artifactId>org.osgi.compendium</artifactId>
    <version>${osgi.version}</version>
</dependency>

Setup the examples against a fabric-based network of brokers

Start a fabric-based network of fault-tolerant (master/slave) brokers. For instructions on how to configure and deploy such a network, see the fabric-ha-setup-master-slave.md.

This configuration features two broker groups networked together, named "amq-east" and "amq-west", each of which is comprised of a master/slave pair (four brokers total). Consumers will connect to the active broker in the "amq-west" group; producers to the active broker in the "amq-east" group, insuring that messages flow across the network. After the example is up and running, one can kill either or both of the active brokers and observe continued message flow across the network.

Running the examples

Follow the instructions in the various consumer and producer paired example modules:

  • simple-consumer and simple-producer
  • camel-consumer and camel-producer

external-mq-fabric-client's People

Contributors

scranton avatar kevinearls avatar chirino avatar dejanb avatar christian-posta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.