简体   繁体   English

如何在Cloud Foundry中从Java调用ruby?

[英]How to call ruby from java in cloud foundry?

I have a requirement where i need to call/trigger the ruby ETL program from java code in the cloud foundry environment. 我有一个需要在云铸造环境中从Java代码调用/触发ruby ETL程序的要求。 will cloudfoundry supports 2 different buildpacks to run on single application instance. cloudfoundry将支持2个不同的构建包以在单个应用程序实例上运行。 Is it possible to run java and ruby processes on the single instance in cloud foundry. 是否可以在Cloud Foundry中的单个实例上运行Java和ruby进程。 I'm new to cloud foundry any help is greatly appreciated. 我是Cloud Foundry的新手,非常感谢您的帮助。

A simple way to have programs written in different programming languages communicate with each other is using REST. 使使用不同编程语言编写的程序相互通信的一种简单方法是使用REST。 Also if asynchronous communication is preferred, you may want to exchange messages via a message broker (eg RabbitMQ). 同样,如果首选异步通信,则可能要通过消息代理(例如RabbitMQ)交换消息。

I would recommend deploying two different apps (one written in Ruby and the other written in Java) and have the ruby app expose a REST endpoint that can be triggered by your java app. 我建议您部署两个不同的应用程序(一个用Ruby编写,另一个用Java编写),并让ruby应用程序公开一个可由Java应用程序触发的REST端点。 You could secure this endpoint using some authentication mechanism (eg HTTP Basic). 您可以使用某种身份验证机制(例如HTTP Basic)来保护此端点。

The possibility of running 2 different buildpacks with a single application does, to the best of my knowlege, not exist. 据我所知,使用单个应用程序运行2个不同的buildpack的可能性确实不存在。 Also this does not seem to be a clean approach in my eyes. 在我看来,这似乎也不是一种干净的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM