Package org.springframework.amqp.rabbit.listener.adapter

Examples of org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter


    }

    final SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(
        template.getConnectionFactory());
    PojoListener listener = new PojoListener(failFrequency);
    container.setMessageListener(new MessageListenerAdapter(listener));
    container.setAcknowledgeMode(AcknowledgeMode.AUTO);
    container.setChannelTransacted(true);
    container.setTxSize(txSize);
    container.setConcurrentConsumers(concurrentConsumers);
View Full Code Here


    this.latch = new CountDownLatch(4);
    ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext("retry-context.xml", this.getClass());
    RabbitTemplate template = ctx.getBean(RabbitTemplate.class);
    ConnectionFactory connectionFactory = ctx.getBean(ConnectionFactory.class);
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
    container.setMessageListener(new MessageListenerAdapter(new POJO()));
    container.setQueueNames("retry.test.queue");

    StatefulRetryOperationsInterceptorFactoryBean fb = new StatefulRetryOperationsInterceptorFactoryBean();

    // use an external template so we can share his cache
View Full Code Here

    this.latch = new CountDownLatch(6);
    ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext("retry-context.xml", this.getClass());
    RabbitTemplate template = ctx.getBean(RabbitTemplate.class);
    ConnectionFactory connectionFactory = ctx.getBean(ConnectionFactory.class);
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
    container.setMessageListener(new MessageListenerAdapter(new POJO()));
    container.setQueueNames("retry.test.queue");

    StatefulRetryOperationsInterceptorFactoryBean fb = new StatefulRetryOperationsInterceptorFactoryBean();

    // use an external template so we can share his cache
View Full Code Here

      return new RabbitListenerContainerTestFactory();
    }

    @Bean
    public MessageListener simpleMessageListener() {
      return new MessageListenerAdapter();
    }
View Full Code Here

    assertNull(template.receiveAndConvert(queue.getName()));
  }

  private SimpleMessageListenerContainer createContainer(Object listener) {
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(template.getConnectionFactory());
    container.setMessageListener(new MessageListenerAdapter(listener));
    container.setQueueNames(queue.getName());
    container.setTxSize(txSize);
    container.setPrefetchCount(txSize);
    container.setConcurrentConsumers(concurrentConsumers);
    container.setChannelTransacted(transactional);
View Full Code Here

  }

  private SimpleMessageListenerContainer createContainer(String queueName, Object listener,
      ConnectionFactory connectionFactory) {
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
    container.setMessageListener(new MessageListenerAdapter(listener));
    container.setQueueNames(queueName);
    container.setTxSize(txSize);
    container.setPrefetchCount(txSize);
    container.setConcurrentConsumers(concurrentConsumers);
    container.setChannelTransacted(transactional);
View Full Code Here

  }

  private SimpleMessageListenerContainer createContainer(String queueName, Object listener,
      ConnectionFactory connectionFactory) {
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
    container.setMessageListener(new MessageListenerAdapter(listener));
    container.setQueueNames(queueName);
    container.setTxSize(txSize);
    container.setPrefetchCount(txSize);
    container.setConcurrentConsumers(concurrentConsumers);
    container.setChannelTransacted(transactional);
View Full Code Here

  @Test
  public void testChannelTransactedOverriddenWhenTxManager() throws Exception {
    final SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory("localhost");
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(singleConnectionFactory);
    container.setMessageListener(new MessageListenerAdapter(this));
    container.setQueueNames("foo");
    container.setChannelTransacted(false);
    container.setTransactionManager(new TestTransactionManager());
    container.afterPropertiesSet();
    assertTrue(TestUtils.getPropertyValue(container, "transactional", Boolean.class));
View Full Code Here

  @Test
  public void testInconsistentTransactionConfiguration() throws Exception {
    final SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory("localhost");
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(singleConnectionFactory);
    container.setMessageListener(new MessageListenerAdapter(this));
    container.setQueueNames("foo");
    container.setChannelTransacted(false);
    container.setAcknowledgeMode(AcknowledgeMode.NONE);
    container.setTransactionManager(new TestTransactionManager());
    expectedException.expect(IllegalStateException.class);
View Full Code Here

  @Test
  public void testInconsistentAcknowledgeConfiguration() throws Exception {
    final SingleConnectionFactory singleConnectionFactory = new SingleConnectionFactory("localhost");
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(singleConnectionFactory);
    container.setMessageListener(new MessageListenerAdapter(this));
    container.setQueueNames("foo");
    container.setChannelTransacted(true);
    container.setAcknowledgeMode(AcknowledgeMode.NONE);
    expectedException.expect(IllegalStateException.class);
    container.afterPropertiesSet();
View Full Code Here

TOP

Related Classes of org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.