Spring Cloud Google Cloud Storage 入站流通道適配器

2024-01-10 15:59 更新

入站流媒體通道適配器與普通的入站通道適配器相似,不同之處在于它不需要將文件存儲(chǔ)在文件系統(tǒng)中。

這是有關(guān)如何配置Google Cloud Storage入站流媒體通道適配器的示例。

@Bean
@InboundChannelAdapter(channel = "streaming-channel", poller = @Poller(fixedDelay = "5000"))
public MessageSource<InputStream> streamingAdapter(Storage gcs) {
  GcsStreamingMessageSource adapter =
          new GcsStreamingMessageSource(new GcsRemoteFileTemplate(new GcsSessionFactory(gcs)));
  adapter.setRemoteDirectory("your-gcs-bucket");
  return adapter;
}
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)