Permalink
Browse files

vertx integration impl

  • Loading branch information...
1 parent 5e8cb93 commit c2a2abf6fa4c5a0892360682575ac8d5b1c4824b @gaohoward gaohoward committed Feb 27, 2014
Showing with 2,603 additions and 3 deletions.
  1. +12 −0 distribution/hornetq/src/main/assembly/dep.xml
  2. +1 −0 docs/user-manual/en/HornetQ_User_Manual.xml
  3. +115 −0 docs/user-manual/en/vertx-integration.xml
  4. +181 −0 examples/core/vertx-connector/pom.xml
  5. +84 −0 examples/core/vertx-connector/readme.html
  6. +43 −0 examples/core/vertx-connector/src/main/java/org/hornetq/core/example/ExampleVerticle.java
  7. +114 −0 examples/core/vertx-connector/src/main/java/org/hornetq/core/example/VertxConnectorExample.java
  8. +59 −0 examples/core/vertx-connector/src/main/resources/server0/hornetq-beans.xml
  9. +61 −0 examples/core/vertx-connector/src/main/resources/server0/hornetq-configuration.xml
  10. +19 −0 examples/core/vertx-connector/src/main/resources/server0/hornetq-jms.xml
  11. +7 −0 examples/core/vertx-connector/src/main/resources/server0/hornetq-users.xml
  12. +127 −0 integration/hornetq-vertx-integration/pom.xml
  13. +63 −0 ...ion/hornetq-vertx-integration/src/main/java/org/hornetq/integration/vertx/HornetQVertxLogger.java
  14. +319 −0 ...netq-vertx-integration/src/main/java/org/hornetq/integration/vertx/IncomingVertxEventHandler.java
  15. +337 −0 ...netq-vertx-integration/src/main/java/org/hornetq/integration/vertx/OutgoingVertxEventHandler.java
  16. +89 −0 ...gration/hornetq-vertx-integration/src/main/java/org/hornetq/integration/vertx/VertxConstants.java
  17. +38 −0 ...integration/src/main/java/org/hornetq/integration/vertx/VertxIncomingConnectorServiceFactory.java
  18. +36 −0 ...integration/src/main/java/org/hornetq/integration/vertx/VertxOutgoingConnectorServiceFactory.java
  19. +9 −3 pom.xml
  20. +37 −0 tests/integration-tests/pom.xml
  21. +852 −0 tests/integration-tests/src/test/java/org/hornetq/tests/integration/vertx/HornetQVertxUnitTest.java
@@ -253,6 +253,18 @@
<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>
<include>org.hornetq.rest:hornetq-rest</include>
</includes>
<binaries>
@@ -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"/>
@@ -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>
@@ -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>
Oops, something went wrong.

0 comments on commit c2a2abf

Please sign in to comment.