activemq-artemis/docs/user-manual/en/vertx-integration.xml

115 lines
6.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================================================= -->
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
<!-- ============================================================================= -->
<!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 "ActiveMQ_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 ActiveMQ and route those messages to a specified vertx address by configuring ActiveMQ 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 ActiveMQ queue.
Such a service can be configured as follows:</para>
<programlisting>
&lt;connector-service name="vertx-incoming-connector">
&lt;factory-class>org.apache.activemq.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 ActiveMQ 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>activemq</literal>.</para>
</listitem>
<listitem>
<para><literal>vertx-address</literal>. The vertx address to listen to. default is org.apache.activemq.</para>
</listitem>
</itemizedlist>
</section>
<section>
<title>Configuring a Vertx Outgoing Connector Service</title>
<para>Vertx Outgoing Connector services fetch vertx messages from a ActiveMQ 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.apache.activemq.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 ActiveMQ 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>activemq</literal>.</para>
</listitem>
<listitem>
<para><literal>vertx-address</literal>. The vertx address to put messages to. default is org.apache.activemq.</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>