Search in sources :

Example 1 with JmsOperations

use of org.springframework.jms.core.JmsOperations in project camel by apache.

the class JmsConfiguration method configureMessageListener.

public void configureMessageListener(EndpointMessageListener listener) {
    if (isDisableReplyTo()) {
        listener.setDisableReplyTo(true);
    }
    if (isEagerLoadingOfProperties()) {
        listener.setEagerLoadingOfProperties(true);
    }
    if (getReplyTo() != null) {
        listener.setReplyToDestination(getReplyTo());
    }
    JmsOperations operations = listener.getTemplate();
    if (operations instanceof JmsTemplate) {
        JmsTemplate template = (JmsTemplate) operations;
        template.setDeliveryPersistent(isReplyToDeliveryPersistent());
    }
}
Also used : JmsTemplate(org.springframework.jms.core.JmsTemplate) JmsOperations(org.springframework.jms.core.JmsOperations)

Example 2 with JmsOperations

use of org.springframework.jms.core.JmsOperations in project camel by apache.

the class JmsEndpoint method getTemporaryQueueType.

/**
     * Lazily loads the temporary queue type if one has not been explicitly configured
     * via calling the {@link JmsProviderMetadata#setTemporaryQueueType(Class)}
     * on the {@link #getConfiguration()} instance
     */
public Class<? extends TemporaryQueue> getTemporaryQueueType() {
    JmsProviderMetadata metadata = getProviderMetadata();
    JmsOperations template = getMetadataJmsOperations();
    return metadata.getTemporaryQueueType(template);
}
Also used : JmsOperations(org.springframework.jms.core.JmsOperations)

Example 3 with JmsOperations

use of org.springframework.jms.core.JmsOperations in project camel by apache.

the class JmsEndpoint method getTemporaryTopicType.

/**
     * Lazily loads the temporary topic type if one has not been explicitly configured
     * via calling the {@link JmsProviderMetadata#setTemporaryTopicType(Class)}
     * on the {@link #getConfiguration()} instance
     */
public Class<? extends TemporaryTopic> getTemporaryTopicType() {
    JmsOperations template = getMetadataJmsOperations();
    JmsProviderMetadata metadata = getProviderMetadata();
    return metadata.getTemporaryTopicType(template);
}
Also used : JmsOperations(org.springframework.jms.core.JmsOperations)

Example 4 with JmsOperations

use of org.springframework.jms.core.JmsOperations in project camel by apache.

the class JmsEndpointConfigurationTest method testReplyToPesistentDelivery.

@Test
public void testReplyToPesistentDelivery() throws Exception {
    JmsEndpoint endpoint = resolveMandatoryEndpoint("jms:queue:Foo", JmsEndpoint.class);
    endpoint.getConfiguration().setDeliveryPersistent(true);
    endpoint.getConfiguration().setReplyToDeliveryPersistent(false);
    Producer producer = endpoint.createProducer();
    assertNotNull("The producer should not be null", producer);
    JmsConsumer consumer = endpoint.createConsumer(dummyProcessor);
    JmsOperations operations = consumer.getEndpointMessageListener().getTemplate();
    assertTrue(operations instanceof JmsTemplate);
    JmsTemplate template = (JmsTemplate) operations;
    assertTrue("Wrong delivery mode on reply template; expected  " + " DeliveryMode.NON_PERSISTENT but was DeliveryMode.PERSISTENT", template.getDeliveryMode() == DeliveryMode.NON_PERSISTENT);
}
Also used : Producer(org.apache.camel.Producer) JmsTemplate(org.springframework.jms.core.JmsTemplate) JmsOperations(org.springframework.jms.core.JmsOperations) Test(org.junit.Test)

Example 5 with JmsOperations

use of org.springframework.jms.core.JmsOperations in project camel by apache.

the class JmsQueueEndpoint method getExchanges.

public List<Exchange> getExchanges() {
    if (queueBrowseStrategy == null) {
        return Collections.emptyList();
    }
    String queue = getDestinationName();
    JmsOperations template = getConfiguration().createInOnlyTemplate(this, false, queue);
    return queueBrowseStrategy.browse(template, queue, this);
}
Also used : JmsOperations(org.springframework.jms.core.JmsOperations)

Aggregations

JmsOperations (org.springframework.jms.core.JmsOperations)6 JmsTemplate (org.springframework.jms.core.JmsTemplate)3 Producer (org.apache.camel.Producer)1 Test (org.junit.Test)1