Java Code Examples for org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory
The following examples show how to use
org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory. These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: spring-analysis-note Source File: JmsListenerAnnotationBeanPostProcessor.java License: MIT License | 5 votes |
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() { DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory(); if (beanFactory != null) { defaultFactory.setBeanFactory(beanFactory); } defaultFactory.afterPropertiesSet(); return defaultFactory; }
Example 2
Source Project: spring-analysis-note Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
@Test public void validatePayloadValid() throws JMSException { String methodName = "validatePayload"; DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); initializeFactory(customFactory); Method method = getListenerMethod(methodName, String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is a valid value assertListenerMethodInvocation(this.sample, methodName); }
Example 3
Source Project: spring-analysis-note Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
@Test public void validatePayloadInvalid() throws JMSException { DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); Method method = getListenerMethod("validatePayload", String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); // test is an invalid value assertThatExceptionOfType(ListenerExecutionFailedException.class).isThrownBy(() -> listener.onMessage(createSimpleJmsTextMessage("invalid value"), session)); }
Example 4
Source Project: spring-analysis-note Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
private MessagingMessageListenerAdapter createInstance( DefaultMessageHandlerMethodFactory factory, Method method, MessageListenerContainer container) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(this.sample); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint.createMessageListener(container); }
Example 5
Source Project: spring-analysis-note Source File: JmsListenerContainerFactoryIntegrationTests.java License: MIT License | 5 votes |
private MethodJmsListenerEndpoint createMethodJmsEndpoint(DefaultMessageHandlerMethodFactory factory, Method method) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(listener); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint; }
Example 6
Source Project: java-technology-stack Source File: JmsListenerAnnotationBeanPostProcessor.java License: MIT License | 5 votes |
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() { DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory(); if (beanFactory != null) { defaultFactory.setBeanFactory(beanFactory); } defaultFactory.afterPropertiesSet(); return defaultFactory; }
Example 7
Source Project: java-technology-stack Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
@Test public void validatePayloadValid() throws JMSException { String methodName = "validatePayload"; DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); initializeFactory(customFactory); Method method = getListenerMethod(methodName, String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is a valid value assertListenerMethodInvocation(this.sample, methodName); }
Example 8
Source Project: java-technology-stack Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
@Test public void validatePayloadInvalid() throws JMSException { DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); Method method = getListenerMethod("validatePayload", String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); this.thrown.expect(ListenerExecutionFailedException.class); listener.onMessage(createSimpleJmsTextMessage("invalid value"), session); // test is an invalid value }
Example 9
Source Project: java-technology-stack Source File: MethodJmsListenerEndpointTests.java License: MIT License | 5 votes |
private MessagingMessageListenerAdapter createInstance( DefaultMessageHandlerMethodFactory factory, Method method, MessageListenerContainer container) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(this.sample); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint.createMessageListener(container); }
Example 10
Source Project: java-technology-stack Source File: JmsListenerContainerFactoryIntegrationTests.java License: MIT License | 5 votes |
private MethodJmsListenerEndpoint createMethodJmsEndpoint(DefaultMessageHandlerMethodFactory factory, Method method) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(listener); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint; }
Example 11
Source Project: heimdall Source File: RabbitConfiguration.java License: Apache License 2.0 | 5 votes |
@Bean public DefaultMessageHandlerMethodFactory messageHandlerMethodFactory() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setMessageConverter(consumerJackson2MessageConverter()); return factory; }
Example 12
Source Project: heimdall Source File: RabbitConfiguration.java License: Apache License 2.0 | 5 votes |
@Bean public DefaultMessageHandlerMethodFactory messageHandlerMethodFactory() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setMessageConverter(consumerJackson2MessageConverter()); return factory; }
Example 13
Source Project: spring4-understanding Source File: MethodJmsListenerEndpointTests.java License: Apache License 2.0 | 5 votes |
@Test public void validatePayloadValid() throws JMSException { String methodName = "validatePayload"; DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); initializeFactory(customFactory); Method method = getListenerMethod(methodName, String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is a valid value assertListenerMethodInvocation(sample, methodName); }
Example 14
Source Project: spring4-understanding Source File: MethodJmsListenerEndpointTests.java License: Apache License 2.0 | 5 votes |
@Test public void validatePayloadInvalid() throws JMSException { DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory(); customFactory.setValidator(testValidator("invalid value")); Method method = getListenerMethod("validatePayload", String.class); MessagingMessageListenerAdapter listener = createInstance(customFactory, method); Session session = mock(Session.class); thrown.expect(ListenerExecutionFailedException.class); listener.onMessage(createSimpleJmsTextMessage("invalid value"), session); // test is an invalid value }
Example 15
Source Project: spring4-understanding Source File: MethodJmsListenerEndpointTests.java License: Apache License 2.0 | 5 votes |
private MessagingMessageListenerAdapter createInstance( DefaultMessageHandlerMethodFactory factory, Method method, MessageListenerContainer container) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(sample); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint.createMessageListener(container); }
Example 16
Source Project: spring4-understanding Source File: JmsListenerContainerFactoryIntegrationTests.java License: Apache License 2.0 | 5 votes |
private MethodJmsListenerEndpoint createMethodJmsEndpoint(DefaultMessageHandlerMethodFactory factory, Method method) { MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint(); endpoint.setBean(listener); endpoint.setMethod(method); endpoint.setMessageHandlerMethodFactory(factory); return endpoint; }
Example 17
Source Project: spring-analysis-note Source File: EnableJmsTests.java License: MIT License | 4 votes |
@Bean public MessageHandlerMethodFactory customMessageHandlerMethodFactory() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setValidator(new TestValidator()); return factory; }
Example 18
Source Project: spring-analysis-note Source File: MessagingMessageListenerAdapterTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 19
Source Project: spring-analysis-note Source File: MethodJmsListenerEndpointTests.java License: MIT License | 4 votes |
private MessagingMessageListenerAdapter createInstance(DefaultMessageHandlerMethodFactory factory, Method method) { return createInstance(factory, method, new SimpleMessageListenerContainer()); }
Example 20
Source Project: spring-analysis-note Source File: MethodJmsListenerEndpointTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 21
Source Project: spring-analysis-note Source File: JmsListenerContainerFactoryIntegrationTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 22
Source Project: java-technology-stack Source File: EnableJmsTests.java License: MIT License | 4 votes |
@Bean public MessageHandlerMethodFactory customMessageHandlerMethodFactory() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setValidator(new TestValidator()); return factory; }
Example 23
Source Project: java-technology-stack Source File: MessagingMessageListenerAdapterTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 24
Source Project: java-technology-stack Source File: MethodJmsListenerEndpointTests.java License: MIT License | 4 votes |
private MessagingMessageListenerAdapter createInstance(DefaultMessageHandlerMethodFactory factory, Method method) { return createInstance(factory, method, new SimpleMessageListenerContainer()); }
Example 25
Source Project: java-technology-stack Source File: MethodJmsListenerEndpointTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 26
Source Project: java-technology-stack Source File: JmsListenerContainerFactoryIntegrationTests.java License: MIT License | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 27
Source Project: spring4-understanding Source File: JmsListenerAnnotationBeanPostProcessor.java License: Apache License 2.0 | 4 votes |
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() { DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory(); defaultFactory.setBeanFactory(beanFactory); defaultFactory.afterPropertiesSet(); return defaultFactory; }
Example 28
Source Project: spring4-understanding Source File: EnableJmsTests.java License: Apache License 2.0 | 4 votes |
@Bean public MessageHandlerMethodFactory customMessageHandlerMethodFactory() { DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory(); factory.setValidator(new TestValidator()); return factory; }
Example 29
Source Project: spring4-understanding Source File: MessagingMessageListenerAdapterTests.java License: Apache License 2.0 | 4 votes |
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) { factory.setBeanFactory(new StaticListableBeanFactory()); factory.afterPropertiesSet(); }
Example 30
Source Project: spring4-understanding Source File: MethodJmsListenerEndpointTests.java License: Apache License 2.0 | 4 votes |
private MessagingMessageListenerAdapter createInstance(DefaultMessageHandlerMethodFactory factory, Method method) { return createInstance(factory, method, new SimpleMessageListenerContainer()); }