本文整理汇总了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");
}
};
}
示例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();
}
};
}
示例5: emit
@StreamEmitter
@Output(Source.OUTPUT)
@Input(Processor.INPUT)
public Flux<String> emit() {
return Flux.interval(Duration.ofMillis(1))
.map(l -> "Hello World!!" + l);
}
示例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();
}
示例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;
}
示例10: sendEvent
@Publisher(channel = Source.OUTPUT)
public DomainEvent sendEvent(DomainEvent event) {
log.info("about to send: " + event);
return event;
}
示例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()));
}
示例12: timerMessageSource
@InboundChannelAdapter(value = Source.OUTPUT)
public String timerMessageSource() {
return new SimpleDateFormat(this.options.getFormat()).format(new Date());
}
示例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");
}
示例14: timeSensorSource
@Bean
@InboundChannelAdapter(value = Source.OUTPUT, poller = @Poller(fixedDelay = "${fixedDelay}", maxMessagesPerPoll = "1"))
public MessageSource<Sensor> timeSensorSource(){
return () -> new GenericMessage<Sensor>(randomSensor());
}
示例15: submit
@Gateway(requestChannel = Source.OUTPUT)
void submit(FeedItem feedItem);