如何使用 Cloud Foundry Java API 从自定义服务绑定请求中获取数据?

How to obtain data from a custom service bind request with the Cloud Foundry Java API?

我也在使用 Cloud Foundry 的 Java Operations Library to perform bind requests to a custom service broker. Recently, I changed the implementation of my custom service broker to provide some data in the response to the bind request. The function call to post a bind request does not support retrieving the body of the response, Mono<Void> bind(BindServiceInstanceRequest request). I have looked into the Cloud Foundry's Java Client Library,但发现也缺少该功能。

如何使用 Cloud Foundry 的库获取绑定响应的主体?

CF Java 库与 Cloud Controller 通信,而不是直接与服务代理通信。 CC API documentation specifies the contract between CC and a client (i.e. your app using the CF Java libraries). The service broker API documentation 指定 CC 和服务代理之间的合同。

I changed the implementation of my custom service broker to provide some data in the response to the bind request

您在回复中提供了哪些数据?正如 service broker API 文档中所述,CC 仅识别列出的字段,所有其他字段将被忽略。文档中列出的字段由 CC 内部存储,不一定在响应 CC API 调用时返回。因此,您不能期望代理的绑定响应中的任意字段将其返回到 CC API 客户端(Java 库或其他)。

您希望 CC API 客户端可用的来自服务代理的任何数据都应添加到代理绑定请求的 credentials 字段中。该字段一直返回到 CC API 客户端,并且是绑定应用程序使用绑定的典型方式。