/** * Determine the name of the listener method that will handle the given message. * <p> * The default implementation first consults the * {@link #setQueueOrTagToMethodName(Map) queueOrTagToMethodName} map looking for a * match on the consumer queue or consumer tag; if no match found, it simply returns * the configured default listener method, or "handleMessage" if not configured. * @param originalMessage the Rabbit request message * @param extractedMessage the converted Rabbit request message, to be passed into the * listener method as argument * @return the name of the listener method (never <code>null</code>) * @see #setDefaultListenerMethod * @see #setQueueOrTagToMethodName */ protected String getListenerMethodName(Message originalMessage, Object extractedMessage) { if (this.queueOrTagToMethodName.size() > 0) { MessageProperties props = originalMessage.getMessageProperties(); String methodName = this.queueOrTagToMethodName.get(props.getConsumerQueue()); if (methodName == null) { methodName = this.queueOrTagToMethodName.get(props.getConsumerTag()); } if (methodName != null) { return methodName; } } return getDefaultListenerMethod(); }
/** * Determine the name of the listener method that will handle the given message. * <p> * The default implementation first consults the * {@link #setQueueOrTagToMethodName(Map) queueOrTagToMethodName} map looking for a * match on the consumer queue or consumer tag; if no match found, it simply returns * the configured default listener method, or "handleMessage" if not configured. * @param originalMessage the Rabbit request message * @param extractedMessage the converted Rabbit request message, to be passed into the * listener method as argument * @return the name of the listener method (never <code>null</code>) * @see #setDefaultListenerMethod * @see #setQueueOrTagToMethodName */ protected String getListenerMethodName(Message originalMessage, Object extractedMessage) { if (this.queueOrTagToMethodName.size() > 0) { MessageProperties props = originalMessage.getMessageProperties(); String methodName = this.queueOrTagToMethodName.get(props.getConsumerQueue()); if (methodName == null) { methodName = this.queueOrTagToMethodName.get(props.getConsumerTag()); } if (methodName != null) { return methodName; } } return getDefaultListenerMethod(); }