クラス GrpcInboundGateway

実装済みのインターフェース一覧:
io.grpc.BindableService, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent

public class GrpcInboundGateway extends MessagingGatewaySupport implements io.grpc.BindableService
gRPC BindableService の MessagingGatewaySupport 実装。このクラスのインスタンスには、gRPC サービス定義の BindableService クラスが必要です。生成された AsyncService インターフェースを実装する標準の 'grpc' サービスのみがサポートされています。このゲートウェイは、gRPC サーバーに登録される BindableService です。gRPC メソッド呼び出しをインターセプトして Spring Integration メッセージに変換するための内部プロキシが作成されます。ダウンストリームフローからのレスポンスは、gRPC レスポンスペイロードに返されます。リクエストペイロードは、gRPC リクエストからの Proto メッセージです。レスポンスペイロードは、gRPC レスポンスの Proto メッセージである必要があります。

このゲートウェイは、すべての gRPC MethodDescriptor.MethodType 型をサポートしています。すべてのリクエストは、MessagingGatewaySupport.sendAndReceiveMessageReactive(Object) を介してリアクティブにダウンストリームフローに送信されます。ダウンストリーム処理ロジックの観点からは、MethodDescriptor.MethodType.UNARY と MethodDescriptor.MethodType.BIDI_STREAMING は同じです。MethodDescriptor.MethodType.CLIENT_STREAMING は、gRPC リクエストペイロードの Flux を生成します。MethodDescriptor.MethodType.SERVER_STREAMING 応答は、単一のエンティティ、またはそれらの Flux になります。

便宜上、GrpcHeaders はリクエストメッセージに格納されます。このような情報は、たとえば、下流フローにおけるルーティングなどに利用できます。

導入:
7.1
作成者:
Artem Bilan, Glenn Renfro
  • コンストラクターの詳細

    • GrpcInboundGateway

      public GrpcInboundGateway(ClassSE<? extends io.grpc.BindableService> grpcServiceClass)
  • 方法の詳細

    • onInit

      protected void onInit()
      クラスからコピーされた説明: IntegrationObjectSupport
      サブクラスは、初期化ロジック用にこれを実装できます。
      オーバーライド:
      クラス MessagingGatewaySupport の onInit 
    • bindService

      public io.grpc.ServerServiceDefinition bindService()
      次で指定:
      インターフェース io.grpc.BindableService 内の bindService