Package org.springframework.integration.endpoint

Examples of org.springframework.integration.endpoint.AbstractEndpoint


        bridgeFactoryBean.setHandler(handler);
        try {
          // TODO: might not be necessary to pass this context, but the FB requires non-null
          bridgeFactoryBean.setBeanFactory(this.context.getBeanFactory());
          bridgeFactoryBean.afterPropertiesSet();
          AbstractEndpoint endpoint = bridgeFactoryBean.getObject();
          endpoints.add(endpoint);
          this.context.getBeanFactory().registerSingleton("bridge-" + i, endpoint);
          endpoint.setComponentName("bridge-" + i);
          endpoint.afterPropertiesSet();
        }
        catch (Exception e) {
          throw new IllegalStateException("failed to start bridge for CompositeModule", e);
        }
      }
View Full Code Here


  }

    @Test
    public void testWithAdvice() throws Exception {
        context = new ClassPathXmlApplicationContext("SmppOutboundGatewayParserTests.xml", getClass());
        AbstractEndpoint endpoint = this.context.getBean("smppOutboundGatewayWithAdvice", AbstractEndpoint.class);
        System.out.println("endpoint "+endpoint);
        MessageHandler handler = TestUtils.getPropertyValue(endpoint, "handler", MessageHandler.class);
        Message<?> message = MessageBuilder.withPayload("foo")
                .setHeader(SmppConstants.SRC_ADDR, "X")
                .setHeader(SmppConstants.DST_ADDR, "Y")
View Full Code Here

  }

    @Test
    public void testWithAdvice() throws Exception {
        context = new ClassPathXmlApplicationContext("SmppOutboundChannelAdapterParserTests.xml", getClass());
        AbstractEndpoint endpoint = this.context.getBean("smppOutboundChannelAdapterWithChain", AbstractEndpoint.class);
        MessageHandler handler = TestUtils.getPropertyValue(endpoint, "handler", MessageHandler.class);
        Message<?> message = MessageBuilder.withPayload("foo")
                .setHeader(SmppConstants.SRC_ADDR, "X")
                .setHeader(SmppConstants.DST_ADDR, "Y")
                .build();
View Full Code Here

    properties.put("transacted", "true"); // test transacted with defaults; not allowed with ackmode NONE
    bus.bindConsumer("props.0", new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    SimpleMessageListenerContainer container = TestUtils.getPropertyValue(endpoint, "messageListenerContainer",
        SimpleMessageListenerContainer.class);
    assertEquals(AcknowledgeMode.AUTO, container.getAcknowledgeMode());
    assertEquals("xdbus.props.0", container.getQueueNames()[0]);
    assertTrue(TestUtils.getPropertyValue(container, "transactional", Boolean.class));
View Full Code Here

    MessageBus bus = getMessageBus();
    bus.bindProducer("props.0", new DirectChannel(), null);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    assertEquals("xdbus.props.0", TestUtils.getPropertyValue(endpoint, "handler.delegate.routingKey"));
    MessageDeliveryMode mode = TestUtils.getPropertyValue(endpoint, "handler.delegate.defaultDeliveryMode",
        MessageDeliveryMode.class);
    assertEquals(MessageDeliveryMode.PERSISTENT, mode);
    List<?> requestHeaders = TestUtils.getPropertyValue(endpoint,
View Full Code Here

    bus.bindRequestor("props.0", new DirectChannel(), new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);

    assertEquals(2, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint(); // producer
    assertEquals("foo.props.0.requests",
        TestUtils.getPropertyValue(endpoint, "handler.delegate.routingKey"));
    MessageDeliveryMode mode = TestUtils.getPropertyValue(endpoint, "handler.delegate.defaultDeliveryMode",
        MessageDeliveryMode.class);
    assertEquals(MessageDeliveryMode.NON_PERSISTENT, mode);
View Full Code Here

    bus.bindReplier("props.0", new DirectChannel(), new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);

    assertEquals(2, bindings.size());
    AbstractEndpoint endpoint = bindings.get(1).getEndpoint(); // producer
    assertEquals(
        "headers['amqp_replyTo']",
        TestUtils.getPropertyValue(endpoint, "handler.delegate.routingKeyExpression", SpelExpression.class).getExpressionString());
    MessageDeliveryMode mode = TestUtils.getPropertyValue(endpoint, "handler.delegate.defaultDeliveryMode",
        MessageDeliveryMode.class);
View Full Code Here

    bus.bindProducer("part.0", output, properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    try {
      AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
      assertThat(getEndpointRouting(endpoint), containsString("part.0-' + headers['partition']"));
    }
    catch (UnsupportedOperationException ignored) {

    }
View Full Code Here

    bus.bindProducer("partJ.0", output, properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    if (usesExplicitRouting()) {
      AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
      assertThat(getEndpointRouting(endpoint), containsString("partJ.0-' + headers['partition']"));
    }

    properties.clear();
    properties.put("concurrency", "2");
View Full Code Here

    properties.put("maxAttempts", "1"); // disable retry
    bus.bindConsumer("props.0", new DirectChannel(), properties);
    @SuppressWarnings("unchecked")
    List<Binding> bindings = TestUtils.getPropertyValue(bus, "messageBus.bindings", List.class);
    assertEquals(1, bindings.size());
    AbstractEndpoint endpoint = bindings.get(0).getEndpoint();
    assertThat(endpoint, instanceOf(RedisQueueMessageDrivenEndpoint.class));
    assertSame(DirectChannel.class, TestUtils.getPropertyValue(endpoint, "outputChannel").getClass());
    bus.unbindConsumers("props.0");
    assertEquals(0, bindings.size());
View Full Code Here

TOP

Related Classes of org.springframework.integration.endpoint.AbstractEndpoint

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.