---
title: "Configure streaming from Aerospike to JMS"
description: "Configure streaming from Aerospike to JMS using the outbound connector and aerospike-jms-outbound.yml."
---

# Configure streaming from Aerospike to JMS

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

Configuring streaming from Aerospike to JMS involves setting up your Aerospike database to send change notifications and modifying the configuration file for the JMS outbound connector: `/etc/aerospike-jms-outbound/aerospike-jms-outbound.yml`. “Outbound” means that the connector receives change notifications from Aerospike, translates them into JSON messages, and places the messages on topics or queues in a JMS message broker. This file is located on the system where you installed the connector package.

## Setting Up Aerospike Database

In your Aerospike database, you must configure Cross-Datacenter Replication (XDR) and enable change notification. You must also configure your JMS cluster to be a “connector” XDR datacenter and the namespace must point to this as xdr remote datacenter. \[//\]: # (Questions:) \[//\]: # (1. Namespace for what?) \[//\]: # (2. Is “xdr remote datacenter” the actual name?) \[//\]: # (3. How does a namespace “point” to anything?)

See the [change notification configuration parameters and example config](https://aerospike.com/docs/connectors/streaming/common/change-notification).

## Modifying aerospike-jms-outbound.yml

You configure streaming from Aerospike to JMS by modifying the `/etc/aerospike-jms-outbound/aerospike-jms-outbound.yml` YAML configuration file. \[//\]: # (What filesystem is this file located in? on the system where you installed the client package. no guidelines yet for provisioning. You can run more than one connector, definitely want to run more than one.)

The configuration file has the following sections:

-   [`service`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/service) Configures the connector’s listening ports, TLS, and network interface.
-   [`jms`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/jms) Configures connection properties for the target JMS message broker.
-   [`bin-transforms`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/bin-transforms) Specifies the bin transformations to apply on the Aerospike record.
-   [`format`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/format) Specifies the message format to use for the outbound messages sent to the message broker.
-   [`batching`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/batching) Specifies how to collect a group of Change Notification Records into a single batch of outbound messages sent to the message broker.
-   [`delivery-mode`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/delivery-mode) Chooses between persistent and non-persistent delivery of messages to the message broker.
-   [`record-ordering`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/record-ordering) Configures ordering of outbound records.
-   [`routing`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/routing) Configures how incoming record updates/deletes from Aerospike are routed to the message broker.
-   [`namespaces`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/namespaces) Configures bin transforms, format, routing at namespace and set level.
-   [`logging`](https://aerospike.com/docs/connectors/streaming/jms/outbound/configure/logging) Configures the destination and level for the connectors logs.

::: caution
If the route or format is not specified for an Aerospike record, then the record is skipped and logged at the _warn_ level.
:::

## Cascading Configuration Values

You can configure the `bin-transforms`, `format`, and `routing` sections to include `default` values, values for each particular namespace, and values for each particular set within a namespace. For each Aerospike record, the appropriate values are applied.

Here is an annotated example:

```yaml
routing:

  mode: static

  destination: default <1>

‎‎

namespaces:

  users:

    routing:

      mode: static

      destination: users <2>

    format:

      mode: flat-json

      metadata-key: metadata

    sets:

      premium:

        routing:

          mode: static

          destination: premium <3>
```

1.  Specifies that records in all namespaces are to be shipped to the `default` topic.
2.  Specifies that records in the `users` namespace are to be shipped to the `users` topic.
3.  Specifies that records in the `premium` set in the `users` namespace are to be shipped to the `premium` topic.

## Example

A sample version of `/etc/aerospike-jms-outbound/aerospike-jms-outbound.yml` for connecting to IBM MQ is shown below:

```yaml
service:

  port: 8080

logging:

  file: /var/log/aerospike-jms-outbound/aerospike-jms-outbound.log

jms:

  factory: com.ibm.mq.jms.MQConnectionFactory

  spec: 2.0

  config:

    hostName: 10.0.2.5

    port: 1414

    queueManager: QM1

    transportType: 1

    channel: DEV.APP.SVRCONN

  credentials:

    username: admin

    password-file: /path/to/password/file.txt

delivery-mode: persistent

format: json

bin-transforms:

  map:

   yellow: red

  transforms:

   - uppercase

routing:

  mode: bin

  type: queue

  bin: category

  default: test-queue

  transforms:

    - trim

    - regex:

        pattern: '[^A-Za-z0-9]'

        replacement: '-'

    - lowercase

namespaces:

  users:

    routing:

      mode: static

      type: queue

      destination: users

    format:

      mode: flat-json

      metadata-key: metadata

    sets:

      premium:

        routing:

          mode: static

          type: queue

          destination: premium

        bin-transforms:

          map:

            gold: platinum
```