Menu Close
Settings Close

Language and Page Formatting Options

Red Hat Training

A Red Hat training course is available for Red Hat AMQ

Chapter 3. Managing addresses

AMQ Online is configured to support managing addresses using the OpenShift command-line tools and the Red Hat AMQ Console. Address resources can be managed like any other OpenShift API resource using oc.

3.1. Address

An address is part of an address space and represents a destination for sending and receiving messages. An address has a type, which defines the semantics of sending messages to and receiving messages from that address.

The types of addresses available in AMQ Online depend on the address space type.

3.2. Address plans

An address is configured with an address plan, which describes the resource usage of that address. The address plans are configured by the service administrator and can vary between AMQ Online installations. The number of addresses that can be created, and what plans are available, depends on quota enforced by the address space plan.

Some address types also support changing the plan field: queue, anycast, and multicast address types in the standard address space support changing the plan as long as the new plan does not exceed the allowed quota. For queues, addresses are dynamically migrated across brokers, which might cause reordering of messages.

3.2.1. Address example

apiVersion: enmasse.io/v1beta1
kind: Address
metadata:
    name: myspace.myqueue 1
spec:
    address: myqueue 2
    type: queue 3
    plan: standard-small-queue 4
1
The address name must be prefixed with the address space name and a dot. Address names can only include alphanumeric characters.
2
The address is the messaging address this address resource represents.
3
The address type dictates the semantics of this address.
4
The address plan describes the resource usage for the address. For more information about how to view the available plans see Listing available address plans.

3.3. Listing available address plans using the command line

You can list the address plans available for an address type, such as queue.

Procedure

  1. Log in as a messaging tenant:

    oc login -u developer
  2. Retrieve the schema with the address plans listed (replace standard with brokered for the brokered address space type):

    oc get addressspaceschema standard -o 'jsonpath={.spec.addressTypes[?(@.name=="queue")].plans[*].name}'

3.4. Creating addresses using the command line

You can create addresses using the command line.

Procedure

  1. Create an address definition:

    apiVersion: enmasse.io/v1beta1
    kind: Address
    metadata:
        name: myspace.myqueue
    spec:
        address: myqueue
        type: queue
        plan: standard-small-queue
    Note

    Prefixing the name with the address space name is required to ensure addresses from different address spaces do not collide.

  2. Create the address:

    oc create -f standard-small-queue.yaml
  3. List the addresses:

    oc get addresses -o yaml

3.5. Creating addresses using the Red Hat AMQ Console

You can create new addresses using the Red Hat AMQ Console. The type of addresses that you can create are determined by the type of address space.

Prerequisites

Procedure

  1. Log in to the Red Hat AMQ Console. For more information, see Accessing the Red Hat AMQ Console.
  2. Click the address space link for the address space where you want to create a new address.
  3. Click New. The Create new address window opens.
  4. Type a name and select the address type. If selecting subscription, from the Topic list select the topic name to which you want to create a subscription.
  5. Click Next.
  6. Select a plan and click Next.
  7. Click Create. Your address is displayed in the Red Hat AMQ Console.

3.6. Replacing addresses using the command line

Procedure

  1. Update an address definition:

    apiVersion: enmasse.io/v1beta1
    kind: Address
    metadata:
        name: myspace.myqueue
    spec:
        address: myqueue
        type: queue
        plan: standard-xlarge-queue
  2. Replace the address:

    oc replace -f standard-xlarge-queue.yaml
  3. List the addresses:

    oc get addresses -o yaml