Use these topics to learn about bus destinations, which applications connected to a service integration bus can use to exchange messages.
When should I use a foreign destination?
Use a foreign destination to explicitly represent a destination on a foreign bus. The foreign bus must be defined to the local bus and must be reachable from the local bus via a direct or indirect link. The foreign destination must be given the bus-qualified name of the actual destination on the foreign bus. A foreign destination must also provide values for a number of key destination attributes; attributes that are required to enable correct processing of messages sent to that destination while they are processed within the local bus. Normally these attributes will have values matching the values of the corresponding destination, although this isn't a requirement.
It is also possible for messages to be sent to a destination on a foreign bus without configuring a foreign destination explicitly. Each foreign bus has a destination defaults template which, when enabled, allows the bus to accept messages to any destination on the foreign bus and provides their key attribute values implicitly. This may be used to reduce the administrative burden on the local bus, however it has a natural limitation that the supplied defaults are applied to all messages, to all foreign destinations, which may be too restrictive. Use of this implicit capability also means that local validation of destination names and local security enforcement is limited. In most production environments, with tighter control expectations, it is expected that this capability is disabled and that explicit foreign destinations will be created as needed.
Foreign destinations, whether explicit or implicit, are always required when configuring multi-bus environments involving foreign buses and their associated inter-bus or WebSphere MQ links.
When should I use an alias destination?
Use an alias destination when you need to make a destination available under an alternative name. The alias destination itself is an abstract destination which directs messages to another target destination. As well as providing an alternative name for a target destination it is also possible to override the values given to a number of key attributes to reflect differences in the usage of each alternative destination name. However, by default, values will be taken from the targeted destination. It is also possible to configure separate access control for the alias destination, although by default this is also delegated to the targeted destination.
Consider a scenario in which messages are sent to one of two Queue destinations, either Q1 or Q2, based on some application-defined criteria. Due to application consolidation, or perhaps geographical realignment, it is now desired that all those messages are delivered to Q1. To avoid changes to the applications it would be possible to replace the queue Q2 with an alias Q2 which targets Q1.
Consider another scenario in which messages are sent to a destination which needs to be changeable dynamically outside of the application's control. One possible way to achieve this would be to use an alias destination whose definition can be changed manually, or using an automated script or program, allowing the administrator to target different destinations over time.
In multi-bus environments it is possible to combine an alias destination with a foreign destination (or an implicit destination derived from the destination defaults of a foreign bus). This allows the flexible redirection capabilities provided by aliases to extend across a bus boundary. For example a message sent by an application to a 'queue' Q1 on the local bus can be aliased to a foreign destination Q3 on bus FB1. Similarly an alias can be used to redirect messages previously sent to a foreign destination to a local destination or even to another foreign destination.
Remember that an alias destination can never be used alone - it must always target another destination. Although it can appear that an alias destination may be used instead of a foreign destination, and with similar capability, this is only possible because an alias may target a foreign destination which is implicitly defined by the destination defaults of a foreign bus. It also requires the alias destination to be named differently than the targeted foreign destination which adds unnecessarily to the set of valid destination names.
Best practice is to use aliases and foreign destinations for the purposes their names suggest.