Java Code Examples for org.springframework.cloud.stream.messaging.Source#OUTPUT

The following examples show how to use org.springframework.cloud.stream.messaging.Source#OUTPUT . These examples are extracted from open source projects. 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 Project: spring-cloud   File: DataProducer.java    License: Apache License 2.0 6 votes vote down vote up
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "10000", maxMessagesPerPoll = "1"))
public MessageSource<TimeInfo> timerMessageSource() {
    return () -> MessageBuilder.withPayload(
            TimeInfo.builder().time(Long.toString(System.currentTimeMillis())).label(UUID.randomUUID().toString()).build())
            .build();
}
 
Example 2
@Bean
public LoggregatorMessageSource loggregatorMessageSource(
		@Qualifier(Source.OUTPUT) MessageChannel source,
		CloudFoundryClient cloudFoundryClient) {
	return new LoggregatorMessageSource(
			this.loggregatorSourceProperties.getApplicationName(),
			cloudFoundryClient, source);
}
 
Example 3
@SneakyThrows
@StreamEmitter
@Output(Source.OUTPUT)
public Flux<MessageResponse> getLatestMessages() {
    return webClient.get()
                    .uri(GitterUriBuilder.from(gitterProperties.getApi())
                                         .build()
                                         .toUri())
                    .retrieve()
                    .bodyToFlux(MessageResponse.class)
                    .timeout(Duration.ofSeconds(1))
                    .retryBackoff(Long.MAX_VALUE, Duration.ofMillis(500));
}
 
Example 4
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "5000", maxMessagesPerPoll = "1"))
public MessageSource<String> timerMessageSource() {
	return new MessageSource<String>() {
		@Override
		public Message<String> receive() {
			throw new MessagingException("test");
		}
	};
}
 
Example 5
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "5000", maxMessagesPerPoll = "1"))
public MessageSource<String> timerMessageSource() {
	return new MessageSource<String>() {
		@Override
		public Message<String> receive() {
			throw new MessagingException("test");
		}
	};
}
 
Example 6
@Output(Source.OUTPUT)
MessageChannel output();
 
Example 7
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "10000", maxMessagesPerPoll = "1"))
public MessageSource<Long> timeMessageSource() {
	return () -> MessageBuilder.withPayload(new Date().getTime()).build();
}
 
Example 8
@Publisher( channel = Source.OUTPUT )
public DomainEvent publish( final DomainEvent event ) {

    return event;
}
 
Example 9
@StreamEmitter
public void emit(@Output(Source.OUTPUT) FluxSender output) {
	output.send(this.flux);
}
 
Example 10
@Output(Source.OUTPUT)
MessageChannel channel3();
 
Example 11
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 12
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 13
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
	return () -> new GenericMessage<Sensor>(randomSensor());
}
 
Example 14
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 15
@Publisher(channel = Source.OUTPUT)
public String send(String payload, @Header UUID uuid) {
    return payload;
}
 
Example 16
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 17
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
	return () -> new GenericMessage<Sensor>(randomSensor());
}
 
Example 18
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "1000", maxMessagesPerPoll = "1"))
public MessageSource<Order> ordersSource() {
	Random r = new Random();
	return () -> new GenericMessage<>(new Order(OrderStatus.NEW, (long) r.nextInt(5), Collections.singletonList((long) r.nextInt(10))));
}
 
Example 19
Source Project: myfeed   File: FeedItemSubmitter.java    License: Apache License 2.0 4 votes vote down vote up
@Gateway(requestChannel = Source.OUTPUT)
void submit(FeedItem feedItem);
 
Example 20
Source Project: shop   File: PublishChannel.java    License: Apache License 2.0 4 votes vote down vote up
@Publisher(channel = Source.OUTPUT)
public String send(String payload, @Header UUID uuid) {
    return payload;
}