Package org.springframework.integration

Examples of org.springframework.integration.MessageChannel.send()


    public void testSendingOneWayMessage() throws Exception {
        MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
        resultEndpoint.expectedBodiesReceived(MESSAGE_BODY);

        MessageChannel outputChannel = getMandatoryBean(MessageChannel.class, "channelA");
        outputChannel.send(new GenericMessage<Object>(MESSAGE_BODY));

        assertMockEndpointsSatisfied();
    }

    @Test
View Full Code Here


                latch.countDown();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  message.getPayload());
            }           
        });

        requestChannel.send(message);

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

    @Test
View Full Code Here

                latch.countDown();
                assertEquals("Get the wrong result", MESSAGE_BODY + " is processed",  message.getPayload());
            }           
        });

        requestChannel.send(message);

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

    @Override
View Full Code Here

    final Car.CarId carId = new Car.CarId( 1 );
    final Car car = new Car( carId, "Ford Mustang" );

    // when
    final Message<Car> message = MessageBuilder.withPayload( car ).setHeader( VoldemortHeaders.KEY, carId ).build();
    voldemortOutboundPutChannel.send( message );

    // then
    final Versioned found = storeClient.get( carId );
    Assert.assertEquals( car, found.getValue() );
View Full Code Here

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).setHeader( VoldemortHeaders.KEY, lukasz.getId() ).build();
    voldemortOutboundPutChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );
View Full Code Here

    // given
    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> firstMessage = MessageBuilder.withPayload( lukasz ).build();
    voldemortOutboundChannel.send( firstMessage );

    // then
    Assert.assertEquals( lukasz, storeClient.get( "constant-key" ).getValue() );

    // given
View Full Code Here

    // given
    final Person tomasz = new Person( "2", "Tomasz", "Antoniak" );

    // when
    final Message<Person> secondMessage = MessageBuilder.withPayload( tomasz ).build();
    voldemortOutboundChannel.send( secondMessage );

    // then
    Assert.assertEquals( tomasz, storeClient.get( "constant-key" ).getValue() );

    context.close();
View Full Code Here

    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );
    storeClient.put( lukasz.getId(), lukasz );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertNull( found );
View Full Code Here

    // when
    // Overriding output adapter's persist mode.
    final Message<Person> message = MessageBuilder.withPayload( lukasz )
        .setHeader( VoldemortHeaders.PERSIST_MODE, PersistMode.PUT ).build();
    voldemortOutboundDeleteChannel.send( message );

    // then
    final Versioned found = storeClient.get( lukasz.getId() );
    Assert.assertEquals( lukasz, found.getValue() );
View Full Code Here

    final Person lukasz = new Person( "1", "Lukasz", "Antoniak" );

    // when
    final Message<Person> message = MessageBuilder.withPayload( lukasz ).build();
    try {
      voldemortStoppedChannel.send( message );
    }
    catch ( MessageDeliveryException e ) {
      return;
    }
    finally {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.