Search in sources :

Example 6 with AbstractMessageListenerContainer

use of org.springframework.jms.listener.AbstractMessageListenerContainer in project camel by apache.

the class JmsEndpointConfigurationTest method testSelector.

@Test
public void testSelector() throws Exception {
    JmsEndpoint endpoint = resolveMandatoryEndpoint("jms:Foo.Bar?selector=foo%3D'ABC'", JmsEndpoint.class);
    JmsConsumer consumer = endpoint.createConsumer(dummyProcessor);
    AbstractMessageListenerContainer container = consumer.getListenerContainer();
    assertEquals("selector", "foo='ABC'", container.getMessageSelector());
    Object object = container.getMessageListener();
    EndpointMessageListener messageListener = assertIsInstanceOf(EndpointMessageListener.class, object);
    assertFalse("Should not have replyToDisabled", messageListener.isDisableReplyTo());
    assertFalse("Should not have isEagerLoadingOfProperties()", messageListener.isEagerLoadingOfProperties());
}
Also used : AbstractMessageListenerContainer(org.springframework.jms.listener.AbstractMessageListenerContainer) Test(org.junit.Test)

Example 7 with AbstractMessageListenerContainer

use of org.springframework.jms.listener.AbstractMessageListenerContainer in project camel by apache.

the class JmsEndpointConfigurationTest method testCreateSimpleMessageListener.

@Test
public void testCreateSimpleMessageListener() throws Exception {
    JmsEndpoint endpoint = resolveMandatoryEndpoint("jms:Foo.Bar?consumerType=Simple", JmsEndpoint.class);
    JmsConsumer consumer = endpoint.createConsumer(dummyProcessor);
    AbstractMessageListenerContainer container = consumer.getListenerContainer();
    assertTrue("Should have been a SimpleMessageListenerContainer", container instanceof SimpleMessageListenerContainer);
}
Also used : SimpleMessageListenerContainer(org.springframework.jms.listener.SimpleMessageListenerContainer) AbstractMessageListenerContainer(org.springframework.jms.listener.AbstractMessageListenerContainer) Test(org.junit.Test)

Aggregations

AbstractMessageListenerContainer (org.springframework.jms.listener.AbstractMessageListenerContainer)7 Test (org.junit.Test)4 JMSException (javax.jms.JMSException)1 Exchange (org.apache.camel.Exchange)1 Processor (org.apache.camel.Processor)1 ResolveEndpointFailedException (org.apache.camel.ResolveEndpointFailedException)1 DefaultMessageListenerContainer (org.springframework.jms.listener.DefaultMessageListenerContainer)1 SimpleMessageListenerContainer (org.springframework.jms.listener.SimpleMessageListenerContainer)1