我正在尝试编写一个简单的 SCDF 流,该流从 Kafka 读取,通过特定值的存在过滤消息并将数据推送到 Mongo。作为其中的一部分,我必须按照#jsonPath 编写
#jsonPath(payload,'$[?(@.metadata!=null)].metadata[?(@.trigger-routing!=
null)].trigger-routing') == {'1'}
Run Code Online (Sandbox Code Playgroud)
我编写了一个示例测试,它将运行 SPeL 并验证它返回的内容(注意:我有意使用 @EnableIntegration 来连接与 SCDF 相同的 SPeL 功能配置文件,至少这是我的理论)
@SpringBootTest(classes = SpelTst.TestConfiguration.class)
public class SpelTst {
@Configuration
@EnableIntegration
public static class TestConfiguration {
}
@Autowired
IntegrationEvaluationContextFactoryBean factory;
@Test
public void test() throws JsonProcessingException {
final StandardEvaluationContext context = factory.getObject();
ExpressionParser parser = new SpelExpressionParser();
Expression exp = parser.parseExpression("#jsonPath(payload,'$[?(@.metadata!=null)].metadata[?(@.trigger-routing!= null)].trigger-routing') == {'1'}");
final PixelHitMessage sampleOne = new PixelHitMessage()
.setMetadata(ImmutableMap.of("trigger-routing", "1"))
.toChildType();
final PixelHitMessage sampleTwo = new PixelHitMessage()
.setMetadata(ImmutableMap.of("trigger-routing", ""))
.toChildType(); …Run Code Online (Sandbox Code Playgroud) 我在 Spring Cloud 数据流中运行任务时收到以下消息。
DEBUG 13167 --- [spring_batch146] com.zaxxer.hikari.pool.HikariPool : HikariPool-2 - Add connection elided, waiting 1, queue 2
Run Code Online (Sandbox Code Playgroud)
我找不到任何相关信息。
由于 Google Cloud Storage 支持对象更改通知,因此它适合丰富插入到存储桶中的对象的良好编程模型,其中服务可以检测该项目并做出相应的反应。这消除了围绕对象更改手动构建通知服务的需要。
但是,假设我们将行级数据(每个数据项,例如用户配置文件名称更改/添加)存储在云存储上,以用户 ID 作为 ID,以实际“名称”作为值,这将导致非常大的数据。桶中小物体的数量。虽然这可以允许系统分析这些数据(例如垃圾邮件检测),但不建议这样做吗?(由于小物体较多)
提前致谢!
我有一个spring-cloud-streamkafka绑定的应用程序.我想从同一个可执行文件(jar)中发送和接收来自同一主题的消息.我有我的频道定义,如下所示: -
public interface ChannelDefinition {
@Input("forum")
public SubscriableChannel readMessage();
@Output("forum")
public MessageChannel postMessage();
}
我@StreamListener用来接收消息.我得到各种意想不到的错误.有时,我收到
是否有上述用例的工作示例?
spring spring-integration spring-boot spring-cloud-stream spring-cloud-dataflow
我是大数据处理的新手,我正在阅读有关流处理和构建数据管道的工具。我找到了 Apache Spark 和 Spring Cloud Data Flow。我想知道它们的主要区别和优缺点。有人可以帮我吗?
基于我所看到的,在Spring Cloud Dataflow(SCDF)中创建流将部署底层应用程序,绑定通信服务(如RabbitMQ),设置Spring Cloud Stream环境变量,并启动应用程序.这可以使用cf push命令轻松完成.
与此同时,我一直遇到Spring Cloud Dataflow的一些缺点:
那我错过了什么?为什么使用Spring Cloud Dataflow只对手动部署应用程序有益?
我有一个带有自己的数据库的任务应用程序,我想在 Spring Cloud Data Flow 中运行。
我的问题是 SCDF 使用 SCDF 的数据源配置覆盖任务中的数据源配置。(这两个数据库都是 Oracle DB。)
我的任务应该写入不同的数据库(但我也想知道它在 SCDF 数据库中的状态)。
如何配置我的任务以连接到其自己的数据库以及 SCDF 的数据库?
我无法http | log按照入门流指南部署和执行基本流
:
wget https://raw.githubusercontent.com/spring-cloud/spring-cloud-dataflow/2.1.0.RELEASE/spring-cloud-dataflow-server/docker-compose.yml;
export DATAFLOW_VERSION=2.1.0.RELEASE;
export SKIPPER_VERSION=2.0.2.RELEASE;
docker-compose up;
open http://localhost:9393/dashboard/#/streams/create;
echo "Then, create a stream via text input: `http | log`"
echo "Then, deploy the stream. The deployment fails with exit code 137."
Run Code Online (Sandbox Code Playgroud)
我得到绿色的“成功部署的流定义”。状态显示为“正在部署”,但从未完全部署。ERROR日志、UI 或网络请求中没有消息。
这是docker-compose up我部署流后的控制台输出。
skipper | 2019-05-24 22:31:53.363 INFO 1 --- [io-7577-exec-10] o.s.s.support.LifecycleObjectSupport : started UPGRADE UPGRADE_DEPLOY_TARGET_APPS_SUCCEED UPGRADE_DEPLOY_TARGET_APPS UPGRADE_START UPGRADE_DELETE_SOURCE_APPS UPGRADE_CHECK_TARGET_APPS UPGRADE_WAIT_TARGET_APPS UPGRADE_CANCEL UPGRADE_DEPLOY_TARGET_APPS_FAILED UPGRADE_CHECK_CHOICE UPGRADE_EXIT INSTALL INSTALL_INSTALL INSTALL_EXIT ERROR DELETE DELETE_DELETE DELETE_EXIT ROLLBACK ROLLBACK_START …Run Code Online (Sandbox Code Playgroud) 我正在设置 Spring Cloud Data Flow 的一个实例。我已经运行了以下命令:
1. Run skipper server: java -jar spring-cloud-skipper-server-2.0.3.RELEASE.jar &
2. Run Dataflow server: java -jar spring-cloud-dataflow-server-2.1.2.RELEASE.jar \
--spring.datasource.url=jdbc:postgresql://10.136.66.44:8080/springclouddataflow \
--spring.datasource.username=springclouddataflow \
--spring.datasource.password=123456 \
--spring.datasource.driver-class-name=org.postgresql.Driver \
--server.port=80 &
Run Code Online (Sandbox Code Playgroud)
在第二步中,我使用的是 postgres 数据库,而不是默认的 h2。
我已经使用 Spring Batch 开发了一个 Spring Boot 作业来部署在这个平台上。该作业使用两个数据源:用于 Spring 的 springclouddataflow 和用于我的业务逻辑的任务元数据和 billrun。当我在本地运行应用程序时,它会按预期将元数据保存在 springclouddataflow 中,并将我的业务数据保存在 billrun 中。问题是当我尝试在 Spring Cloud Dataflow 中执行 de job 时。平台忽略我配置的业务逻辑数据库,只使用 springclouddataflow 数据库,它应该只存储元数据。
我在官方文档中搜索过。它解释了如何使用不同的数据库进行元数据存储以及如何在应用程序中配置多个数据库。我已按照说明进行操作,但没有成功。
应用程序属性
logging.level.org.springframework.cloud.task=debug
spring.datasource.initialization-mode=always
spring.batch.initialize-schema=always
spring.application.name=Bill Run
spring.datasource.jdbc-url=jdbc:postgresql://10.136.66.44:8080/springclouddataflow?useSSL=false
spring.datasource.username=springclouddataflow
spring.datasource.password=123456
spring.datasource.driver-class-name=org.postgresql.Driver
app.datasource.jdbc-url=jdbc:postgresql://10.136.66.44:8080/billrun?useSSL=false
app.datasource.username=springclouddataflow
app.datasource.password=123456
app.datasource.driver-class-name=org.postgresql.Driver
Run Code Online (Sandbox Code Playgroud)
数据源配置
@Configuration …Run Code Online (Sandbox Code Playgroud) 我正在编写简单的应用程序来熟悉 Spring Batch。我想学习 Spring Batch admin,但我发现它已被弃用,所以我必须使用 Spring Cloud Data Flow。
我找到了有关 Spring Cloud 数据的教程并执行了第一步:
添加依赖项:
编译(“org.springframework.cloud:spring-cloud-starter-dataflow-server-local:1.7.4.RELEASE”)
并用附加注释标记了我的 Spring Boot 应用程序类:
@EnableDataFlowServer
现在我尝试使用 idea 运行它,但它打印:
10:24:09.590 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:340)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202)
at spring.boot.hello.world.MyApplication.main(MyApplication.java:11)
Run Code Online (Sandbox Code Playgroud)