Queue aliases and clusters
Use queue aliases to hide the name of a cluster queue, to cluster a queue, adopt different attributes, or adopt different access controls.
A
QALIAS
definition is used to create an alias by which a queue is to be known. You might create an alias for a number of reasons:- You want to start using a different queue but you do not want to change your applications.
- You do not want applications to know the real name of the queue to which they are putting messages.
- You might have a naming convention that differs from the one where the queue is defined.
- Your applications might not be authorized to access the queue by its real name but only by its alias.
Create a
QALIAS
definition on a queue manager using the DEFINE QALIAS
command. For example, run the command:
DEFINE QALIAS(PUBLIC) TARGET(LOCAL) CLUSTER(C)
The command advertises a queue called PUBLIC
to the queue managers in cluster C
. PUBLIC
is an alias that resolves to the queue called LOCAL
. Messages sent to PUBLIC
are routed to the queue called LOCAL
.
You can also use a queue alias definition to resolve a queue name to a cluster queue. For example, run the command:
DEFINE QALIAS(PRIVATE) TARGET(PUBLIC)
The command enables a queue manager to use the name PRIVATE
to access a queue advertised elsewhere in the cluster by the name PUBLIC
. Because this definition does not include the CLUSTER
attribute it applies only to the queue manager that makes it.