Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Ce contenu n'est pas disponible dans la langue sélectionnée.
19.2. Using a Custom Destination Resolver
Overview Copier lienLien copié sur presse-papiers!
Destination objects. For example, if you specify an endpoint's destination using the destinationName attribute, the endpoint will use a destination resolver to get the appropriate JMS Destination object. Destination resolvers are also used if a destination chooser returns a string and not a JMS Destination object.
DynamicDestinationResolver destination resolver provided by the Spring Framework. This destination resolver uses the standard JMS Session.createTopic() and Session.createQueue() methods to resolve destination names.
JndiDestinationResolver destination resolver. This destination resolver uses the string destination name to perform a JNDI lookup for the JMS destination. If JMS destination is not returned from the JNDI lookup, the resolver resorts to dynamically resolving the destination name. For information on configuring and endpoint to use the JndiDestinationResolver destination resolver. See the section called “Configuring an endpoint to use a destination resolver”.
Implementing a destination resolver Copier lienLien copié sur presse-papiers!
org.springframework.jms.support.destination.DestinationResolver interface. The interface has a single method: resolveDestinationName().
resolveDestinationName() method, whose signature shown in Example 19.5, “Destination Resolver Method”, takes three parameters: a JMS session, a destination name, and a boolean specifying if the destination is a JMS topic.[2] It returns a JMS destination that correlates to the provided destination name.
Example 19.5. Destination Resolver Method
Destination resolveDestinationName(Session session,
String destinationName,
boolean pubSubDomain)
throws JMSException;Example 19.6. Simple Destination Resolver
Configuring an endpoint to use a destination resolver Copier lienLien copié sur presse-papiers!
- Configure a
beanelement for your destination resolver. - Add a
destinationResolverattribute that references the destination resolver's bean to your endpoint.
Example 19.7. Configuring a Destination Resolver with a Bean Reference
jms:destinationResolver element. This method is less flexible than the recommended method because other endpoints cannot reuse the destination resolver's configuration.
Example 19.8. Explicitly Configuring a Destination Resolver