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 . 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 File: DataProducer.java    From spring-cloud with 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
Source File: LoggregatorSourceConfiguration.java    From spring-cloud-stream-app-starters with Apache License 2.0 5 votes vote down vote up
@Bean
public LoggregatorMessageSource loggregatorMessageSource(
		@Qualifier(Source.OUTPUT) MessageChannel source,
		CloudFoundryClient cloudFoundryClient) {
	return new LoggregatorMessageSource(
			this.loggregatorSourceProperties.getApplicationName(),
			cloudFoundryClient, source);
}
 
Example 3
Source File: GitterService.java    From Hands-On-Reactive-Programming-in-Spring-5 with MIT License 5 votes vote down vote up
@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
Source File: CustomPartitionedProducerTest.java    From spring-cloud-stream with Apache License 2.0 5 votes vote down vote up
@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
Source File: CustomPartitionedProducerTest.java    From spring-cloud-stream with Apache License 2.0 5 votes vote down vote up
@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
Source File: CommentController.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 7
Source File: PublishChannel.java    From shop with Apache License 2.0 4 votes vote down vote up
@Publisher(channel = Source.OUTPUT)
public String send(String payload, @Header UUID uuid) {
    return payload;
}
 
Example 8
Source File: FeedItemSubmitter.java    From myfeed with Apache License 2.0 4 votes vote down vote up
@Gateway(requestChannel = Source.OUTPUT)
void submit(FeedItem feedItem);
 
Example 9
Source File: OrderApplication.java    From Mastering-Spring-Cloud with MIT License 4 votes vote down vote up
@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 10
Source File: SensorSource.java    From schema-evolution-samples with Apache License 2.0 4 votes vote down vote up
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
	return () -> new GenericMessage<Sensor>(randomSensor());
}
 
Example 11
Source File: CommentController.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 12
Source File: PublishChannel.java    From functional-eventsourcing with Apache License 2.0 4 votes vote down vote up
@Publisher(channel = Source.OUTPUT)
public String send(String payload, @Header UUID uuid) {
    return payload;
}
 
Example 13
Source File: CommentController.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 14
Source File: SensorSource.java    From schema-evolution-samples with Apache License 2.0 4 votes vote down vote up
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
	return () -> new GenericMessage<Sensor>(randomSensor());
}
 
Example 15
Source File: CommentController.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
Example 16
Source File: RocketMqConfig.java    From microservices-platform with Apache License 2.0 4 votes vote down vote up
@Output(Source.OUTPUT)
MessageChannel output();
 
Example 17
Source File: StreamListenerMethodSetupOrchestratorTests.java    From spring-cloud-stream with Apache License 2.0 4 votes vote down vote up
@Output(Source.OUTPUT)
MessageChannel channel3();
 
Example 18
Source File: CommentController.java    From Learning-Spring-Boot-2.0-Second-Edition with MIT License 4 votes vote down vote up
@StreamEmitter
public void emit(@Output(Source.OUTPUT) FluxSender output) {
	output.send(this.flux);
}
 
Example 19
Source File: DomainEventSourceImpl.java    From event-store-demo with GNU General Public License v3.0 4 votes vote down vote up
@Publisher( channel = Source.OUTPUT )
public DomainEvent publish( final DomainEvent event ) {

    return event;
}
 
Example 20
Source File: SimpleTimeSourceApplication.java    From rocketmq-binder-demo with Apache License 2.0 4 votes vote down vote up
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "10000", maxMessagesPerPoll = "1"))
public MessageSource<Long> timeMessageSource() {
	return () -> MessageBuilder.withPayload(new Date().getTime()).build();
}