Skip to content

Commit

Permalink
Merge pull request #1552 from gaohoward/andy_vertx_master
Browse files Browse the repository at this point in the history
vertx integration
  • Loading branch information
andytaylor committed Feb 28, 2014
2 parents 5e8cb93 + c2a2abf commit 747472b
Show file tree
Hide file tree
Showing 21 changed files with 2,603 additions and 3 deletions.
12 changes: 12 additions & 0 deletions distribution/hornetq/src/main/assembly/dep.xml
Expand Up @@ -250,6 +250,18 @@
<outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
</binaries>
</moduleSet>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
<include>org.hornetq:hornetq-vertx-integration</include>
</includes>
<binaries>
<includeDependencies>false</includeDependencies>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
<outputFileNameMapping>${module.artifactId}.${module.extension}</outputFileNameMapping>
</binaries>
</moduleSet>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
<includes>
Expand Down
1 change: 1 addition & 0 deletions docs/user-manual/en/HornetQ_User_Manual.xml
Expand Up @@ -65,6 +65,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="embedding-hornetq.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="spring-integration.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aerogear-integration.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="vertx-integration.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="intercepting-operations.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="interoperability.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tools.xml"/>
Expand Down
115 changes: 115 additions & 0 deletions docs/user-manual/en/vertx-integration.xml
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================================= -->
<!-- Copyright © 2009 Red Hat, Inc. and others. -->
<!-- -->
<!-- The text of and illustrations in this document are licensed by Red Hat under -->
<!-- a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). -->
<!-- -->
<!-- An explanation of CC-BY-SA is available at -->
<!-- -->
<!-- http://creativecommons.org/licenses/by-sa/3.0/. -->
<!-- -->
<!-- In accordance with CC-BY-SA, if you distribute this document or an adaptation -->
<!-- of it, you must provide the URL for the original version. -->
<!-- -->
<!-- Red Hat, as the licensor of this document, waives the right to enforce, -->
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "HornetQ_User_Manual.ent">
%BOOK_ENTITIES;
]>
<chapter id="vertx-integration">
<title>Vert.x Integration</title>
<para><ulink url="http://vertx.io/">Vert.x</ulink> is a lightweight, high performance application platform for the
JVM that's designed for modern mobile, web, and enterprise applications. Vert.x provides a distributed event bus that
allows messages to be sent across vert.x instances and clients. You can now redirect and persist any vert.x messages
to HornetQ and route those messages to a specified vertx address by configuring HornetQ vertx incoming and outgoing
vertx connector services.
</para>

<section>
<title>Configuring a Vertx Incoming Connector Service</title>
<para>Vertx Incoming Connector services receive messages from vertx event bus and route them to a HornetQ queue.
Such a service can be configured as follows:</para>
<programlisting>
&lt;connector-service name="vertx-incoming-connector">
&lt;factory-class>org.hornetq.integration.vertx.VertxIncomingConnectorServiceFactory&lt;/factory-class>
&lt;param key="host" value="127.0.0.1"/>
&lt;param key="port" value="0"/>
&lt;param key="queue" value="jms.queue.vertxQueue"/>
&lt;param key="vertx-address" value="vertx.in.eventaddress"/>
&lt;/connector-service>
</programlisting>
<para>Shown are the required params for the connector service:</para>
<itemizedlist>
<listitem>
<para><literal>queue</literal>. The name of the HornetQ queue to send message to.</para>
</listitem>
</itemizedlist>
<para>As well as these required paramaters there are the following optional parameters</para>
<itemizedlist>
<listitem>
<para><literal>host</literal>. The host name on which the vertx target container is running. Default is localhost.</para>
</listitem>
<listitem>
<para><literal>port</literal>. The port number to which the target vertx listens. Default is zero.</para>
</listitem>
<listitem>
<para><literal>quorum-size</literal>. The quorum size of the target vertx instance.</para>
</listitem>
<listitem>
<para><literal>ha-group</literal>. The name of the ha-group of target vertx instance. Default is <literal>hornetq</literal>.</para>
</listitem>
<listitem>
<para><literal>vertx-address</literal>. The vertx address to listen to. default is org.hornetq.</para>
</listitem>
</itemizedlist>
</section>

<section>
<title>Configuring a Vertx Outgoing Connector Service</title>
<para>Vertx Outgoing Connector services fetch vertx messages from a HornetQ queue and put them to vertx event bus.
Such a service can be configured as follows:</para>
<programlisting>
&lt;connector-service name="vertx-outgoing-connector">
&lt;factory-class>org.hornetq.integration.vertx.VertxOutgoingConnectorServiceFactory&lt;/factory-class>
&lt;param key="host" value="127.0.0.1"/>
&lt;param key="port" value="0"/>
&lt;param key="queue" value="jms.queue.vertxQueue"/>
&lt;param key="vertx-address" value="vertx.out.eventaddress"/>
&lt;param key="publish" value="true"/>
&lt;/connector-service>
</programlisting>
<para>Shown are the required params for the connector service:</para>
<itemizedlist>
<listitem>
<para><literal>queue</literal>. The name of the HornetQ queue to fetch message from.</para>
</listitem>
</itemizedlist>
<para>As well as these required paramaters there are the following optional parameters</para>
<itemizedlist>
<listitem>
<para><literal>host</literal>. The host name on which the vertx target container is running. Default is localhost.</para>
</listitem>
<listitem>
<para><literal>port</literal>. The port number to which the target vertx listens. Default is zero.</para>
</listitem>
<listitem>
<para><literal>quorum-size</literal>. The quorum size of the target vertx instance.</para>
</listitem>
<listitem>
<para><literal>ha-group</literal>. The name of the ha-group of target vertx instance. Default is <literal>hornetq</literal>.</para>
</listitem>
<listitem>
<para><literal>vertx-address</literal>. The vertx address to put messages to. default is org.hornetq.</para>
</listitem>
<listitem>
<para><literal>publish</literal>. How messages is sent to vertx event bus. "true" means using publish style.
"false" means using send style. Default is false.</para>
</listitem>
</itemizedlist>
</section>
</chapter>
181 changes: 181 additions & 0 deletions examples/core/vertx-connector/pom.xml
@@ -0,0 +1,181 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.hornetq.examples.core</groupId>
<artifactId>core-examples</artifactId>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>hornetq-vertx-example</artifactId>
<packaging>jar</packaging>
<name>HornetQ Vert.x Example</name>

<properties>
<vertx.version>2.1RC1</vertx.version>
</properties>
<dependencies>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jms-api</artifactId>
<version>1.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnp-client</artifactId>
<version>5.0.5.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_2.0_spec</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-platform</artifactId>
<version>${vertx.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>${vertx.version}</version>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<systemProperties>
<property>
<name>build.directory</name>
<value>${basedir}/target/</value>
</property>
</systemProperties>
</configuration>
</execution>
<execution>
<id>runClient</id>
<goals>
<goal>runClient</goal>
</goals>
<configuration>
<clientClass>org.hornetq.core.example.VertxConnectorExample</clientClass>
</configuration>
</execution>
<execution>
<id>stop</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.hornetq.examples.core</groupId>
<artifactId>hornetq-vertx-example</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-vertx-integration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jms-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
<artifactId>jboss-jms-api</artifactId>
<version>1.1.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnpserver</artifactId>
<version>5.0.3.GA</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-platform</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>${vertx.version}</version>
</dependency>
</dependencies>
<configuration>
<waitOnStart>false</waitOnStart>
<hornetqConfigurationDir>${basedir}/target/classes/server0</hornetqConfigurationDir>
</configuration>
</plugin>
</plugins>
</build>


</project>

0 comments on commit 747472b

Please sign in to comment.