2

我有一个流,它会根据给定的时间间隔启动任务。我想与它一起使用rabbit binder,但我缺少提供rabbitmq 代理属性的语法。有人可以帮助我。

Here is the steps and configuration I have.

 1. Imported apps using: app import --uri
    http//bitly/stream-applications-rabbit-maven
 2. Registered a task: app register --name task-sink --type sink --uri file://tasksink.jar
 3. Created stream: stream create foo --definition "triggertask --triggertask.uri=file://task-file.jar --trigger.cron-expression=10 | task-sink" 
 4. stream deploy foo --properties "spring.rabbitmq.host=myhost,         spring.rabbitmq.username=user,spring.rabbitmq.password=pass,     spring.rabbitmq.port=5672,spring.rabbitmq.virtual-host=XXX"

When both stream and runtime apps are deployed but I see error on logs saying connection could not be established.
I changed the properties syntax to "spring.cloud.stream.bindings.rabbitmq.host" also but same error.
I am not sure I am not using correct syntax here but below are some different behaviour when i run it on VPN and without VPN.

**Note**: 
Case 1: Both my machines (where SCDF is running and RabbitMQ broker) are in core network (VPN). Even if I run SCDF and RabbitMq on my local machine It does not work and says unable to resolve host.
Case 2: But when I run RabbitMQ and SCDF on my local machine (Not connected to VPN) then it works fine with "spring.rabbitmq.username=user" properties syntax.
Is there any setting which I need to change to connect to different host system?
Thanks in advance for help and suggestion.
4

1 回答 1

1

spring.rabbitmq.host=myhost是正确的,但是由于您将其传递给 Spring Cloud Data Flow DSL 中的应用程序,因此您需要在其前面加上应用程序名称,即app.triggertask.spring.rabbitmq.host等。其他应用程序也是如此。您有一些可用的快捷方式,请参阅:

http://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#_passing_application_properties_when_deploying_a_stream

http://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#spring-cloud-dataflow-global-properties

详情。

于 2016-09-22T19:17:33.580 回答