Java Code Examples for org.springframework.jms.config.DefaultJmsListenerContainerFactory#setConnectionFactory()

The following examples show how to use org.springframework.jms.config.DefaultJmsListenerContainerFactory#setConnectionFactory() . 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: ServiceSpringModuleConfig.java    From herd with Apache License 2.0 6 votes vote down vote up
/**
 * Gets a JMS listener container factory that returns a JMS listener container for the storage policy processor JMS message listener service.
 *
 * @param jmsConnectionFactory the JMS connection factory
 *
 * @return the JMS listener container factory
 */
@Bean
public DefaultJmsListenerContainerFactory storagePolicyProcessorJmsListenerContainerFactory(ConnectionFactory jmsConnectionFactory)
{
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(jmsConnectionFactory);
    factory.setDestinationResolver(herdDestinationResolver);
    factory.setConcurrency(configurationHelper.getProperty(ConfigurationValue.STORAGE_POLICY_PROCESSOR_JMS_LISTENER_POOL_CONCURRENCY_LIMITS));

    return factory;
}
 
Example 2
Source File: ServiceSpringModuleConfig.java    From herd with Apache License 2.0 6 votes vote down vote up
/**
 * Gets a JMS listener container factory that can return a JMS listener container.
 *
 * @param jmsConnectionFactory the JMS connection factory
 *
 * @return the JMS listener container factory
 */
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(ConnectionFactory jmsConnectionFactory)
{
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(jmsConnectionFactory);
    factory.setDestinationResolver(herdDestinationResolver);
    factory.setConcurrency(configurationHelper.getProperty(ConfigurationValue.JMS_LISTENER_POOL_CONCURRENCY_LIMITS));

    return factory;
}
 
Example 3
Source File: EventRegistryJmsConfiguration.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(ConnectionFactory connectionFactory) {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory);

    // configuration properties are Spring Boot defaults
    factory.setPubSubDomain(false);
    factory.setSessionTransacted(true);
    factory.setAutoStartup(true);
    factory.setReceiveTimeout(Duration.ofSeconds(1).toMillis());

    return factory;
}
 
Example 4
Source File: ReceiverConfig.java    From spring-jms with MIT License 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
  DefaultJmsListenerContainerFactory factory =
      new DefaultJmsListenerContainerFactory();
  factory
      .setConnectionFactory(receiverActiveMQConnectionFactory());
  factory.setConcurrency("3-10");

  return factory;
}
 
Example 5
Source File: ReceiverConfig.java    From spring-jms with MIT License 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
  DefaultJmsListenerContainerFactory factory =
      new DefaultJmsListenerContainerFactory();
  factory
      .setConnectionFactory(receiverActiveMQConnectionFactory());

  return factory;
}
 
Example 6
Source File: ReceiverConfig.java    From spring-jms with MIT License 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
  DefaultJmsListenerContainerFactory factory =
      new DefaultJmsListenerContainerFactory();
  factory
      .setConnectionFactory(receiverActiveMQConnectionFactory());
  factory.setConcurrency("3-10");

  return factory;
}
 
Example 7
Source File: ReceiverConfig.java    From spring-jms with MIT License 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
  DefaultJmsListenerContainerFactory factory =
      new DefaultJmsListenerContainerFactory();
  factory
      .setConnectionFactory(receiverActiveMQConnectionFactory());
  factory.setPubSubDomain(true);

  return factory;
}
 
Example 8
Source File: ReceiverConfig.java    From spring-jms with MIT License 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory orderDefaultJmsListenerContainerFactory() {
  DefaultJmsListenerContainerFactory factory =
      new DefaultJmsListenerContainerFactory();
  factory
      .setConnectionFactory(receiverActiveMQConnectionFactory());
  factory.setConcurrency("3-10");

  return factory;
}
 
Example 9
Source File: ActivemqConfiguration.java    From jim-framework with Apache License 2.0 5 votes vote down vote up
public JmsListenerContainerFactory<?> jmsListenerBContainerQueue() {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    ActiveMQConnectionFactory connectionFactory=new ActiveMQConnectionFactory(Constans.CONSUMER_B_BROKER_URL);
    //connectionFactory
    bean.setConnectionFactory(connectionFactory);
    bean.setConcurrency("3-10");

    return bean;
}
 
Example 10
Source File: ActivemqConfiguration.java    From jim-framework with Apache License 2.0 5 votes vote down vote up
public JmsListenerContainerFactory<?> jmsListenerAContainerQueue() {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();

    bean.setConnectionFactory(this.pooledConnectionFactory);
    bean.setConcurrency("3-10");

    return bean;
}
 
Example 11
Source File: JmsConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * Jms listener container queue jms listener container factory.
 *
 * @param activeMQConnectionFactory the active mq connection factory
 * @return the jms listener container factory
 */
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 12
Source File: JmsConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * Jms listener container queue jms listener container factory.
 *
 * @param activeMQConnectionFactory the active mq connection factory
 * @return the jms listener container factory
 */
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 13
Source File: JmsConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 14
Source File: JmsConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * Jms listener container queue jms listener container factory.
 *
 * @param activeMQConnectionFactory the active mq connection factory
 * @return the jms listener container factory
 */
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 15
Source File: JmsConfig.java    From myth with Apache License 2.0 5 votes vote down vote up
/**
 * Jms listener container queue jms listener container factory.
 *
 * @param activeMQConnectionFactory the active mq connection factory
 * @return the jms listener container factory
 */
@Bean(name = "queueListenerContainerFactory")
@ConditionalOnProperty(prefix = "spring.activemq", name = "broker-url")
public JmsListenerContainerFactory<?> jmsListenerContainerQueue(ConnectionFactory activeMQConnectionFactory) {
    DefaultJmsListenerContainerFactory bean = new DefaultJmsListenerContainerFactory();
    bean.setConnectionFactory(activeMQConnectionFactory);
    bean.setPubSubDomain(Boolean.FALSE);
    return bean;
}
 
Example 16
Source File: JndiConsumerConfiguration.java    From solace-jms-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory cFactory(DemoErrorHandler errorHandler) {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory((ConnectionFactory) consumerConnectionFactory().getObject());
    factory.setDestinationResolver(consumerJndiDestinationResolver());
    factory.setErrorHandler(errorHandler);
    factory.setConcurrency("3-10");
   return factory;
}
 
Example 17
Source File: ConsumerConfiguration.java    From solace-jms-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory cFactory(ConnectionFactory connectionFactory, DemoErrorHandler errorHandler) {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory);
    factory.setErrorHandler(errorHandler);
    return factory;
}
 
Example 18
Source File: ActiveMQConfig.java    From hdw-dubbo with Apache License 2.0 5 votes vote down vote up
@Bean(name = "queueJmsListenerContainerFactory")
public JmsListenerContainerFactory<?> queueJmsListenerContainerFactory() {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setPubSubDomain(false);
    factory.setConnectionFactory(cachingConnectionFactory());
    return factory;
}
 
Example 19
Source File: ApplicationConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    factory.setConnectionFactory(connectionFactory());
    return factory;
}
 
Example 20
Source File: SpringJmsTest.java    From java-specialagent with Apache License 2.0 4 votes vote down vote up
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
  final DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
  factory.setConnectionFactory(connectionFactory());
  return factory;
}