@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { setDestinationResolver(new BeanFactoryMessageChannelDestinationResolver(beanFactory)); }
@Override public void send(String destinationName, Message<?> message) { D destination = resolveDestination(destinationName); doSend(destination, message); }
/** * Configure a {@link MessageConverter} to use to convert the payload of a message from * its serialized form with a specific MIME type to an Object matching the target method * parameter. The converter is also used when sending a message to the message broker. * @see CompositeMessageConverter */ public void setMessageConverter(MessageConverter converter) { this.messageConverter = converter; ((AbstractMessageSendingTemplate<?>) this.clientMessagingTemplate).setMessageConverter(converter); }
@Override @Nullable public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass) { D destination = resolveDestination(destinationName); return super.convertSendAndReceive(destination, request, targetClass); }
@Override protected final void doSend(MessageChannel channel, Message<?> message) { doSend(channel, message, sendTimeout(message)); }
@Override public void send(Message<?> message) { send(getRequiredDefaultDestination(), message); }
@Override @Nullable public Message<?> receive(String destinationName) { D destination = resolveDestination(destinationName); return super.receive(destination); }
@Override @Nullable public Message<?> sendAndReceive(String destinationName, Message<?> requestMessage) { D destination = resolveDestination(destinationName); return super.sendAndReceive(destination, requestMessage); }
@Override @Nullable public <T> T receiveAndConvert(String destinationName, Class<T> targetClass) { D destination = resolveDestination(destinationName); return super.receiveAndConvert(destination, targetClass); }
@Override public <T> void convertAndSend(String destinationName, T payload, @Nullable Map<String, Object> headers, @Nullable MessagePostProcessor postProcessor) { D destination = resolveDestination(destinationName); super.convertAndSend(destination, payload, headers, postProcessor); }
@Before public void setup() { TestMessageChannelDestinationResolver resolver = new TestMessageChannelDestinationResolver(); this.myChannel = new ExecutorSubscribableChannel(); resolver.registerMessageChannel("myChannel", this.myChannel); this.template = new TestDestinationResolvingMessagingTemplate(); this.template.setDestinationResolver(resolver); this.headers = Collections.<String, Object>singletonMap("key", "value"); this.postProcessor = new TestMessagePostProcessor(); }
@Override public void convertAndSend(D destination, Object payload) throws MessagingException { convertAndSend(destination, payload, (Map<String, Object>) null); }
@Override public boolean send(Message<?> message) { return this.send(message, -1); }
@Override public void send(D destination, Message<?> message) { doSend(destination, message); }
@Override public <T> void convertAndSend(String destinationName, T payload) { convertAndSend(destinationName, payload, null, null); }
@Before public void setup() { this.template = new TestMessagingTemplate(); this.postProcessor = new TestMessagePostProcessor(); this.headers = Collections.<String, Object>singletonMap("key", "value"); }
@Override @Nullable public <T> T convertSendAndReceive(String destinationName, Object request, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) { D destination = resolveDestination(destinationName); return super.convertSendAndReceive(destination, request, targetClass, postProcessor); }
@Override public void convertAndSend(Object payload) throws MessagingException { convertAndSend(payload, null); }
@Override @Nullable public <T> T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass) { D destination = resolveDestination(destinationName); return super.convertSendAndReceive(destination, request, headers, targetClass); }
@Override @Nullable public <T> T convertSendAndReceive(String destinationName, Object request, @Nullable Map<String, Object> headers, Class<T> targetClass, @Nullable MessagePostProcessor postProcessor) { D destination = resolveDestination(destinationName); return super.convertSendAndReceive(destination, request, headers, targetClass, postProcessor); }