org.springframework.cloud.stream.messaging.Source.output()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.springframework.cloud.stream.messaging.Source.output()方法的一些代码示例,展示了Source.output()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Source.output()方法的具体详情如下:
包路径:org.springframework.cloud.stream.messaging.Source
类名称:Source
方法名:output

Source.output介绍

暂无

代码示例

代码示例来源:origin: joshlong/cloud-native-workshop

ReservationApiAdapterRestController(ReservationReader reader,
                  Source source) {
  this.reader = reader;
  this.out = source.output();
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-source-load-generator

@Override
  public void run() {
    logger.info(String.format("Producer %d sending %d messages", this.producerId, this.messageCount));
    Message<byte[]> message = new GenericMessage<>(new byte[this.messageSize]);
    for (int i = 0; i < this.messageCount; i++) {
      channel.output().send(message);
    }
    logger.info("All Messages Dispatched");
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-app-starters

@Override
  public void run() {
    logger.info(String.format("Producer %d sending %d messages", this.producerId, this.messageCount));
    Message<byte[]> message = new GenericMessage<>(new byte[this.messageSize]);
    for (int i = 0; i < this.messageCount; i++) {
      channel.output().send(message);
    }
    logger.info("All Messages Dispatched");
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-app-starters

private void sendMessage(Object body, Object contentType) {
    channels.output().send(MessageBuilder.createMessage(body,
        new MessageHeaders(Collections.singletonMap(MessageHeaders.CONTENT_TYPE, contentType))));
  }
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-source-jms

@Bean
public ChannelPublishingJmsMessageListener listener() {
  ChannelPublishingJmsMessageListener listener = new ChannelPublishingJmsMessageListener();
  listener.setRequestChannel(channels.output());
  return listener;
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v1 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v1 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream

private MessageChannel getOutputChannel() {
    return this.processor != null ? this.processor.output()
        : (this.source != null ? this.source.output() : new NullChannel());
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v1 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v2 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v2 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messages", method = RequestMethod.POST)
public String sendMessage() {
  source.output().send(MessageBuilder.withPayload(randomSensor()).build());
  return "ok, have fun with v2 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messagesX", method = RequestMethod.POST)
  public String sendMessageX(@RequestParam(value="id") String id, @RequestParam(value="acceleration") float acceleartion,
                @RequestParam(value="velocity") float velocity, @RequestParam(value="temperature") float temperature) {
    Sensor sensor = new Sensor();
    sensor.setId(id + "-v1");
    sensor.setAcceleration(acceleartion);
    sensor.setVelocity(velocity);
    sensor.setTemperature(temperature);
    source.output().send(MessageBuilder.withPayload(sensor).build());
    return "ok, have fun with v1 payload!";
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messagesX", method = RequestMethod.POST)
  public String sendMessageX(@RequestParam(value="id") String id, @RequestParam(value="acceleration") float acceleartion,
                @RequestParam(value="velocity") float velocity, @RequestParam(value="temperature") float temperature) {
    Sensor sensor = new Sensor();
    sensor.setId(id + "-v2");
    sensor.setAcceleration(acceleartion);
    sensor.setVelocity(velocity);
    sensor.setInternalTemperature(temperature);
    source.output().send(MessageBuilder.withPayload(sensor).build());
    return "ok, have fun with v2 payload!";
  }
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@RequestMapping(value = "/messagesX", method = RequestMethod.POST)
public String sendMessageX(@RequestParam(value="id") String id, @RequestParam(value="acceleration") float acceleartion,
              @RequestParam(value="velocity") float velocity, @RequestParam(value="temperature") float temperature) {
  Sensor sensor = new Sensor();
  sensor.setId(id + "-v1");
  sensor.setAcceleration(acceleartion);
  sensor.setVelocity(velocity);
  sensor.setTemperature(temperature);
  source.output().send(MessageBuilder.withPayload(sensor).build());
  return "ok, have fun with v1 payload!";
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-samples

@Bean
public IntegrationFlow pollingFlow() {
  IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(jdbcMessageSource());
  flowBuilder.channel(this.source.output());
  return flowBuilder.get();
}

代码示例来源:origin: spring-cloud/spring-cloud-stream-app-starters

@Bean
public TcpReceivingChannelAdapter adapter(
    @Qualifier("tcpClientConnectionFactory") AbstractConnectionFactory connectionFactory) {
  TcpReceivingChannelAdapter adapter = new TcpReceivingChannelAdapter();
  adapter.setConnectionFactory(connectionFactory);
  adapter.setClientMode(true);
  adapter.setRetryInterval(this.properties.getRetryInterval());
  adapter.setOutputChannel(this.source.output());
  return adapter;
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-source-jdbc

@Bean
public IntegrationFlow pollingFlow() {
  IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(jdbcMessageSource());
  if (this.properties.isSplit()) {
    flowBuilder.split();
  }
  flowBuilder.channel(this.source.output());
  return flowBuilder.get();
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-source-rabbit

@Bean
public AmqpInboundChannelAdapter adapter() throws Exception {
  return Amqp.inboundAdapter(container()).outputChannel(channels.output())
      .mappedRequestHeaders(properties.getMappedRequestHeaders())
      .get();
}

代码示例来源:origin: org.springframework.cloud.stream.app/spring-cloud-starter-stream-source-syslog

private void setAdapterProperties(SyslogReceivingChannelAdapterSupport adapter) {
  adapter.setPort(this.properties.getPort());
  adapter.setConverter(syslogConverter());
  adapter.setOutputChannel(this.channels.output());
}

相关文章