Java Code Examples for org.springframework.jms.listener.DefaultMessageListenerContainer#setDestinationName()

The following examples show how to use org.springframework.jms.listener.DefaultMessageListenerContainer#setDestinationName() . 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 File: SolaceController.java    From solace-samples-cloudfoundry-java with Apache License 2.0 5 votes vote down vote up
public DefaultMessageListenerContainer createListener(String destination) {
    // do something here to create a message listener container
    DefaultMessageListenerContainer lc = new DefaultMessageListenerContainer();
    lc.setConnectionFactory(connectionFactory);
    lc.setDestinationName(destination);
    lc.setMessageListener(new SimpleMessageListener());
    lc.setPubSubDomain(true);
    lc.initialize();
    return lc;
}
 
Example 2
Source File: SolaceController.java    From solace-samples-cloudfoundry-java with Apache License 2.0 5 votes vote down vote up
public DefaultMessageListenerContainer createListener(String destination) {
    // do something here to create a message listener container
    DefaultMessageListenerContainer lc = new DefaultMessageListenerContainer();
    lc.setConnectionFactory((ConnectionFactory) connectionFactory.getObject());
    lc.setDestinationResolver(jndiDestinationResolver);
    lc.setDestinationName(destination);
    lc.setMessageListener(new SimpleMessageListener());
    lc.setPubSubDomain(true);
    lc.initialize();
    return lc;
}
 
Example 3
Source File: MessagingConfig.java    From pro-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public DefaultMessageListenerContainer messageListener() {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(this.connectionFactory);
	container.setDestinationName(queue);
	container.setMessageListener(new Consumer());
	return container;
}
 
Example 4
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public DefaultMessageListenerContainer serverRequestListenerContainer() {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(singleConnectionFactory());
  container.setDestinationName("replaced-at-runtime");
  container.setSessionTransacted(false);
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(10);
  container.setAutoStartup(false);
  return container;
}
 
Example 5
Source File: JmsConfig.java    From c2mon with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Bean
public DefaultMessageListenerContainer secondServerRequestListenerContainer() {
  DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
  container.setConnectionFactory(secondSingleConnectionFactory());
  container.setDestinationName("replaced-at-runtime");
  container.setSessionTransacted(false);
  container.setMaxMessagesPerTask(1);
  container.setReceiveTimeout(1000);
  container.setIdleTaskExecutionLimit(10);
  container.setAutoStartup(false);
  return container;
}
 
Example 6
Source File: StubRunnerJmsConfiguration.java    From spring-cloud-contract with Apache License 2.0 5 votes vote down vote up
private MessageListenerContainer listenerContainer(String queueName,
		ConnectionFactory connectionFactory, MessageListener listener) {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(connectionFactory);
	container.setDestinationName(queueName);
	container.setMessageListener(listener);
	return container;
}
 
Example 7
Source File: MessagingConfig.java    From pro-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public DefaultMessageListenerContainer messageListener() {
	DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
	container.setConnectionFactory(this.connectionFactory);
	container.setDestinationName(queue);
	container.setMessageListener(new Consumer());
	return container;
}