Monday, 3 March 2014

HornetQ Vert.x Integration Available


HornetQ now provides Vert.x connector services that can redirect and persist vert.x messages to HornetQ queues and route those messages to a specified vertx address.
Vert.x 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.

There are two kinds of Vert.x connector services, an incoming connector service and an outgoing connector service.

An incoming connector service listens to the Vert.x event bus on a configured address for messages and routes them to a configured HornetQ queue. An outgoing connector
service consumes from a configured HornetQ queue and sends/publishes them to Vert.x event bus on a configured address.

The following diagram illustrates how messages flow from the Vert.x event bus to the HornetQ core queue through an incoming connector, and then from the HornetQ core
queue back to Vert.x event bus through an outgoing connector.


1 Configuring a Vertx Incoming Connector Service


Below is an example for a Vert.x incoming connector service:


<connector-service name="vertx-incoming-connector">
  <factory-class>org.hornetq.integration.vertx.VertxIncomingConnectorServiceFactory</factory-class>
  <param key="host" value="127.0.0.1"/>
  <param key="port" value="0"/>
  <param key="queue" value="jms.queue.vertxQueue"/>
  <param key="vertx-address" value="vertx.in.eventaddress"/>
</connector-service>


Shown are the required params for the connector service:

• queue. The name of the HornetQ queue to send message to.

As well as these required parameters there are the following optional parameters:

• host. The host name on which the vertx target container is running. Default is localhost.
• port. The port number to which the target vertx listens. Default is zero.
• quorum-size. The quorum size of the target vertx instance.
• ha-group. The name of the ha-group of target vertx instance. Default is hornetq.
• vertx-address. The vertx address to listen to. default is org.hornetq.

2 Configuring a Vertx Outgoing Connector Service


Below is an example for a Vert.x outgoing connector service:


<connector-service name="vertx-outgoing-connector">
  <factory-class>org.hornetq.integration.vertx.VertxOutgoingConnectorServiceFactory</factory-class>
  <param key="host" value="127.0.0.1"/>
  <param key="port" value="0"/>
  <param key="queue" value="jms.queue.vertxQueue"/>
  <param key="vertx-address" value="vertx.out.eventaddress"/>
   <param key="publish" value="true"/>
</connector-service>


Shown are the required params for the connector service:

• queue. The name of the HornetQ queue to fetch message from.

As well as these required paramaters there are the following optional parameters:

• host. The host name on which the vertx target container is running. Default is localhost.
• port. The port number to which the target vertx listens. Default is zero.
• quorum-size. The quorum size of the target vertx instance.
• ha-group. The name of the ha-group of target vertx instance. Default is hornetq.
• vertx-address. The vertx address to put messages to. default is org.hornetq.
• publish. How messages is sent to vertx event bus. "true" means using publish style. "false"
means using send style. Default is false.

No comments:

Post a comment