Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.AmqpTemplate


    assertTrue(latch.await(0, TimeUnit.SECONDS));
  }

  @Test
  public void testWithRepublishRecovererExplicitExchangeAndRouting() throws Throwable {
    AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

    RetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateless()
        .recoverer(new RepublishMessageRecoverer(amqpTemplate, "bar", "baz"))
        .build();
View Full Code Here


    verify(amqpTemplate).send("bar", "baz", message);
  }

  @Test
  public void testWithRepublishRecovererDefaultExchangeAndRouting() throws Throwable {
    AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

    RetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateless()
        .recoverer(new RepublishMessageRecoverer(amqpTemplate))
        .build();
View Full Code Here

    verify(amqpTemplate).send("error.foo", message);
  }

  @Test
  public void testWithRepublishRecovererDefaultExchangeAndRoutingCustomPrefix() throws Throwable {
    AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

    RetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateless()
        .recoverer(new RepublishMessageRecoverer(amqpTemplate).errorRoutingKeyPrefix("bar."))
        .build();
View Full Code Here

    verify(amqpTemplate).send("bar.foo", message);
  }

  @Test
  public void testWithRepublishRecovererCustomExchangeAndDefaultRoutingCustomPrefix() throws Throwable {
    AmqpTemplate amqpTemplate = mock(AmqpTemplate.class);

    RetryOperationsInterceptor interceptor = RetryInterceptorBuilder.stateless()
        .recoverer(new RepublishMessageRecoverer(amqpTemplate, "baz").errorRoutingKeyPrefix("bar."))
        .build();
View Full Code Here

    reader.loadBeanDefinitions(new ClassPathResource(getClass().getSimpleName() + "-context.xml", getClass()));
  }

  @Test
  public void testTemplate() throws Exception {
    AmqpTemplate template = beanFactory.getBean("template", AmqpTemplate.class);
    assertNotNull(template);
    assertEquals(Boolean.FALSE, TestUtils.getPropertyValue(template, "mandatoryExpression.value"));
    assertNull(TestUtils.getPropertyValue(template, "returnCallback"));
    assertNull(TestUtils.getPropertyValue(template, "confirmCallback"));
  }
View Full Code Here

    assertNull(TestUtils.getPropertyValue(template, "confirmCallback"));
  }

  @Test
  public void testTemplateWithCallbacks() throws Exception {
    AmqpTemplate template = beanFactory.getBean("withCallbacks", AmqpTemplate.class);
    assertNotNull(template);
    assertEquals("true", TestUtils.getPropertyValue(template, "mandatoryExpression.literalValue"));
    assertNotNull(TestUtils.getPropertyValue(template, "returnCallback"));
    assertNotNull(TestUtils.getPropertyValue(template, "confirmCallback"));
  }
View Full Code Here

    assertNotNull(TestUtils.getPropertyValue(template, "confirmCallback"));
  }

  @Test
  public void testTemplateWithMandatoryExpression() throws Exception {
    AmqpTemplate template = beanFactory.getBean("withMandatoryExpression", AmqpTemplate.class);
    assertNotNull(template);
    assertEquals("'true'", TestUtils.getPropertyValue(template, "mandatoryExpression.expression"));
    assertEquals("'foo'",
        TestUtils.getPropertyValue(template, "sendConnectionFactorySelectorExpression.expression"));
    assertEquals("'foo'",
View Full Code Here

    serviceExporter.setServiceInterface(TestServiceInterface.class);

    // Set up the client
    AmqpProxyFactoryBean amqpProxyFactoryBean = new AmqpProxyFactoryBean();
    amqpProxyFactoryBean.setServiceInterface(TestServiceInterface.class);
    AmqpTemplate directForwardingTemplate = new AbstractAmqpTemplate() {
      @Override
      public Object convertSendAndReceive(Object payload) throws AmqpException {
        MessageConverter messageConverter = serviceExporter.getMessageConverter();

        Address replyTo = new Address("fakeExchangeName", "fakeRoutingKey");
View Full Code Here

TOP

Related Classes of org.springframework.amqp.core.AmqpTemplate

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.