通过JSON标头进行Spring Cloud Dataflow路由

时间:2022-09-21 15:46:29

I have been trying to create a stream with Spring Cloud Dataflow but have not had much luck (mostly due to the lack of documentation).

我一直在尝试使用Spring Cloud Dataflow创建一个流但没有太多运气(主要是由于缺少文档)。

Issue 1: Accessing web GUI of dockerized Spring Cloud Dataflow I have a dockerized Spring Cloud server running with Kafka on a basic Ubuntu container. For some reason I can't access the web GUI in Windows (at < docker-machine ip >:9393/dashboard). However, I have a separate Docker Ubuntu container running Nginx reverse proxy, which shows up when I go to < docker-machine ip >/index.html or etc. I don't think it is an issue with ports, I have the Spring Cloud container setup with -p 9393:9393 and the port is otherwise unused.

问题1:访问dockerized Spring Cloud Dataflow的Web GUI我在基本的Ubuntu容器上有一个与Kafka一起运行的dockerized Spring Cloud服务器。出于某种原因,我无法访问Windows中的Web GUI(在 :9393 / dashboard)。但是,我有一个单独的Docker Ubuntu容器运行Nginx反向代理,当我去 /index.html等时出现。我不认为这是端口的问题,我有春天使用-p 9393:9393进行云容器设置,否则端口未使用。

Issue 2: Routing by JSON Header My ultimate goal is to get a file loaded in from Nginx and routed based on its JSON header (there are two different JSON headers) and then ingest queries to Cassandra. I can do all of this except the sorting by JSON header. Which app would you recommend I use?

问题2:通过JSON标头进行路由我的最终目标是从Nginx加载文件并根据其JSON标头(有两个不同的JSON标头)进行路由,然后将查询提取到Cassandra。我可以做所有这些,除了按JSON头排序。你会推荐我使用哪个应用程序?

1 个解决方案

#1


2  

Issue 1: Accessing web GUI of dockerized Spring Cloud Dataflow

问题1:访问dockerized Spring Cloud Dataflow的Web GUI

We might need little more details around this. Assuming this is the local-server, perhaps you could share the docker scripts/image, so we could try it out.

我们可能需要更多细节。假设这是本地服务器,也许你可以共享docker脚本/图像,所以我们可以尝试一下。

Issue 2: Routing by JSON Header

问题2:通过JSON标头进行路由

The router-sink application would come handy for this type of use-cases. This application routes the payload to named destinations based on certain conditions, so you'd have the opportunity to route the payload with respective ingest-query to Cassandra.

路由器接收器应用程序对于这种类型的用例会很方便。此应用程序根据特定条件将有效负载路由到命名目标,因此您可以使用相应的接收查询将有效负载路由到Cassandra。

stream 1:

流1:

stream create test --definition "file | router --expression=header.contains('a')?':foo':':bar’"

stream 2:

流2:

stream create baz --definition ":foo > cassandra --ingest-query=\"query1\""

stream 3:

流3:

stream create wiz --definition ":bar > cassandra --ingest-query=\"query2\""

(where: foo and bar are named destinations)

(其中:foo和bar是命名目的地)

#1


2  

Issue 1: Accessing web GUI of dockerized Spring Cloud Dataflow

问题1:访问dockerized Spring Cloud Dataflow的Web GUI

We might need little more details around this. Assuming this is the local-server, perhaps you could share the docker scripts/image, so we could try it out.

我们可能需要更多细节。假设这是本地服务器,也许你可以共享docker脚本/图像,所以我们可以尝试一下。

Issue 2: Routing by JSON Header

问题2:通过JSON标头进行路由

The router-sink application would come handy for this type of use-cases. This application routes the payload to named destinations based on certain conditions, so you'd have the opportunity to route the payload with respective ingest-query to Cassandra.

路由器接收器应用程序对于这种类型的用例会很方便。此应用程序根据特定条件将有效负载路由到命名目标,因此您可以使用相应的接收查询将有效负载路由到Cassandra。

stream 1:

流1:

stream create test --definition "file | router --expression=header.contains('a')?':foo':':bar’"

stream 2:

流2:

stream create baz --definition ":foo > cassandra --ingest-query=\"query1\""

stream 3:

流3:

stream create wiz --definition ":bar > cassandra --ingest-query=\"query2\""

(where: foo and bar are named destinations)

(其中:foo和bar是命名目的地)