当前位置: 首页>>代码示例>>Java>>正文


Java Source.OUTPUT属性代码示例

本文整理汇总了Java中org.springframework.cloud.stream.messaging.Source.OUTPUT属性的典型用法代码示例。如果您正苦于以下问题:Java Source.OUTPUT属性的具体用法?Java Source.OUTPUT怎么用?Java Source.OUTPUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.cloud.stream.messaging.Source的用法示例。


在下文中一共展示了Source.OUTPUT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stockPriceChangeEvent

@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "60000", maxMessagesPerPoll = "1"))
public MessageSource<StockPriceChangeEvent> stockPriceChangeEvent() {

	StockTicker[] tickers = StockTicker.values();
	String randomStockTicker = tickers[ThreadLocalRandom.current().nextInt(tickers.length)].name();

	return () -> {
		StockPriceChangeEvent event = new StockPriceChangeEvent(randomStockTicker,
				new BigDecimal(getRandomNumber(10, 20)), new BigDecimal(getRandomNumber(10, 20)));

		logger.info("sending " + event);
		return MessageBuilder.withPayload(event).build();
	};
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Spring-5.0,代码行数:15,代码来源:SignificantStockChangeSourceApplication.java

示例2: loggregatorMessageSource

@Bean
public LoggregatorMessageSource loggregatorMessageSource(
		@Qualifier(Source.OUTPUT) MessageChannel source,
		CloudFoundryClient cloudFoundryClient) {
	return new LoggregatorMessageSource(
			this.loggregatorSourceProperties.getApplicationName(),
			cloudFoundryClient, source);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-app-starters,代码行数:8,代码来源:LoggregatorSourceConfiguration.java

示例3: timerMessageSource

@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");
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:10,代码来源:CustomPartitionedProducerTest.java

示例4: timerMessageSource

@Bean
@InboundChannelAdapter(Source.OUTPUT)
public MessageSource<String> timerMessageSource() {
	return new MessageSource<String>() {
		@Override
		public Message<String> receive() {
			return MessageBuilder.withPayload(new SimpleDateFormat("DDMMMYYYY").format(new Date())).setHeader(MessageHeaders.CONTENT_TYPE,"text/plain").build();
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:10,代码来源:TestSource.java

示例5: emit

@StreamEmitter
@Output(Source.OUTPUT)
@Input(Processor.INPUT)
public Flux<String> emit() {
	return Flux.interval(Duration.ofMillis(1))
			.map(l -> "Hello World!!" + l);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:7,代码来源:StreamEmitterValidationTests.java

示例6: emit

@StreamEmitter
@Output(Source.OUTPUT)
@Bean
public Publisher<Message<String>> emit() {
	AtomicInteger atomicInteger = new AtomicInteger();
	return IntegrationFlows.from(() ->
					new GenericMessage<>("Hello World!!" + atomicInteger.getAndIncrement()),
			e -> e.poller(p -> p.fixedDelay(1)))
			.<String, String>transform(String::toUpperCase)
			.toReactivePublisher();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:11,代码来源:StreamEmitterBasicTests.java

示例7: emit

@StreamEmitter
public void emit(@Output(Source.OUTPUT) FluxSender output) {
	output.send(this.flux);
}
 
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:4,代码来源:CommentController.java

示例8: emit

@StreamEmitter
@Output(Source.OUTPUT)
public void emit(FluxSender output) {
	output.send(this.flux);
}
 
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:5,代码来源:CommentController.java

示例9: send

@Publisher(channel = Source.OUTPUT)
public String send(String payload, @Header UUID uuid) {
    return payload;
}
 
开发者ID:pilloPl,项目名称:functional-eventsourcing,代码行数:4,代码来源:PublishChannel.java

示例10: sendEvent

@Publisher(channel = Source.OUTPUT)
public DomainEvent sendEvent(DomainEvent event) {
    log.info("about to send: " + event);
    return event;

}
 
开发者ID:pilloPl,项目名称:webinar-events,代码行数:6,代码来源:EventPublisher.java

示例11: timerMessageSource

@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<String> timerMessageSource() {
	return () -> new GenericMessage<>(new SimpleDateFormat(this.format).format(new Date()));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-samples,代码行数:5,代码来源:SourceModuleDefinition.java

示例12: timerMessageSource

@InboundChannelAdapter(value = Source.OUTPUT)
public String timerMessageSource() {
	return new SimpleDateFormat(this.options.getFormat()).format(new Date());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-samples,代码行数:4,代码来源:TimeSource.java

示例13: fooBarStrings

@Bean
@InboundChannelAdapter(channel = Source.OUTPUT, poller = @Poller(fixedDelay = "100"))
public MessageSource<String> fooBarStrings() {
	return () ->
			new GenericMessage<>(this.semaphore.getAndSet(!this.semaphore.get()) ? "foo" : "bar");
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-stream-samples,代码行数:6,代码来源:FooBarSource.java

示例14: timeSensorSource

@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
	return () -> new GenericMessage<Sensor>(randomSensor());
}
 
开发者ID:viniciusccarvalho,项目名称:schema-evolution-samples,代码行数:5,代码来源:SensorSource.java

示例15: submit

@Gateway(requestChannel = Source.OUTPUT)
void submit(FeedItem feedItem);
 
开发者ID:spencergibb,项目名称:myfeed,代码行数:2,代码来源:FeedItemSubmitter.java


注:本文中的org.springframework.cloud.stream.messaging.Source.OUTPUT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。